sys-apps/openrc provides /lib64/rc/sh/tmpfiles.sh, which is the back end for /etc/init.d/tmpfiles.setup
There is a typo in tmpfiles.sh, '"$args"' should be '"$arg"'.
tmpfiles.sh 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.
Steps to Reproduce:
1. Create a link rule (L) in /etc/tmpfiles.d/*
2. Run /lib64/rc/sh/tmpfiles.sh --create --remove
3. Enjoy your error.
ln: failed to create symbolic link '/var/run/something' -> '': No such file or directory [ !! ]
The symlink should be created.
I'll attach a simple one-liner patch.
Comments in /lib64/rc/sh/tmpfiles.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.
Created attachment 353408 [details, diff]
Fix for tmpfiles.sh L rule typo
This has been applied in commit 3af434a and will be in OpenRc-0.12.