Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 477006

Summary: sys-apps/openrc-0.11.8 - typo prevents 'L' rules from working
Product: Gentoo Hosted Projects Reporter: Hank Leininger <hlein>
Component: OpenRCAssignee: OpenRC Team <openrc>
Severity: normal Keywords: PATCH
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 439098    
Attachments: Fix for L rule typo

Description Hank Leininger 2013-07-16 03:05:04 UTC
sys-apps/openrc provides /lib64/rc/sh/, which is the back end for /etc/init.d/tmpfiles.setup

There is a typo in, '"$args"' should be '"$arg"'. reads config lines from /etc/tmpfiles.d/* and creates files, directories, or links with the necessary ownership and permissions.  It's mostly intended to allow you to populate /var/run after bootup, since it is now a ramdisk, so nothing is persistent.

There is a typo in the handler for symlink rules (L), in the function _L.  The argument that should become the target of the symlink is read into the variable $arg, but then the ln command line is built with it as $args.  Since that variable is not set, ln gets one fewer arguments than it expects, and fails.

Reproducible: Always

Steps to Reproduce:
1. Create a link rule (L) in /etc/tmpfiles.d/*
2. Run /lib64/rc/sh/ --create --remove
3. Enjoy your error.
Actual Results:  
ln: failed to create symbolic link '/var/run/something' -> '': No such file or directory                                 [ !! ]

Expected Results:  
The symlink should be created.

I'll attach a simple one-liner patch.

Comments in /lib64/rc/sh/ indicate that Gentoo imported this from Arch, but the URL seems to no longer be valid, so I don't know if this bug is something we inherited from them, or unique to Gentoo.
Comment 1 Hank Leininger 2013-07-16 03:06:15 UTC
Created attachment 353408 [details, diff]
Fix for L rule typo
Comment 2 William Hubbs gentoo-dev 2013-07-17 16:45:18 UTC
This has been applied in commit 3af434a and will be in OpenRc-0.12.