Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 477006 - sys-apps/openrc-0.11.8 - typo prevents 'L' rules from working
Summary: sys-apps/openrc-0.11.8 - typo prevents 'L' rules from working
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: OpenRC (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: OpenRC Team
Keywords: PATCH
Depends on:
Blocks: 439098
  Show dependency tree
Reported: 2013-07-16 03:05 UTC by Hank Leininger
Modified: 2013-07-17 16:45 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---

Fix for L rule typo (openrc_tmpfiles_L-args.patch,390 bytes, patch)
2013-07-16 03:06 UTC, Hank Leininger
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.