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

Bug 649480

Summary: stage3 - missing symlinks from sys-apps/opentmpfiles in /etc/runlevel
Product: Gentoo Release Media Reporter: Piotr Karbowski (RETIRED) <slashbeast>
Component: StagesAssignee: William Hubbs <williamh>
Status: RESOLVED FIXED    
Severity: normal CC: bkohler, chesguy, openrc, releng, williamh
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Piotr Karbowski (RETIRED) gentoo-dev 2018-03-03 19:55:00 UTC
The logic in sys-apps/opentmpfiles ebuild is to install symlinks in /etc/runlevel only if it's first installation. Stage3 is shipped with opentmpfiles but miss te runlevel symlinks, making it a broken functionality, because unless one add it manually, it will never get autostarted.

It's easy to check on, for example in stage3-amd64-20180301T214503Z, there's no /etc/runlevels/sysinit/opentmpfiles-dev and /etc/runlevels/boot/opentmpfiles-setup



Reproducible: Always
Comment 1 Piotr Karbowski (RETIRED) gentoo-dev 2018-03-13 18:57:59 UTC
Bump
Comment 2 Piotr Karbowski (RETIRED) gentoo-dev 2018-04-08 11:49:59 UTC
Bump
Comment 3 chesguy 2018-04-15 01:32:04 UTC
I noticed the same thing using stage3-amd64-20180408T214502Z.tar.xz.  Confirmed that a couple other systems I've installed are also missing opentmpfiles in the runlevels.  Found this bug trying to figure out if I should or shouldn't have these services enabled.
Comment 4 Piotr Karbowski (RETIRED) gentoo-dev 2018-09-09 11:54:48 UTC
Bump
Comment 5 Ben Kohler gentoo-dev 2018-09-09 13:52:06 UTC
>>> Installing (17 of 205) sys-apps/opentmpfiles-0.1.3::gentoo
 * checking 6 files for package collisions
>>> Merging sys-apps/opentmpfiles-0.1.3 to /
--- /etc/
--- /etc/init.d/
>>> /etc/init.d/opentmpfiles-setup
>>> /etc/init.d/opentmpfiles-dev
--- /etc/conf.d/
>>> /etc/conf.d/opentmpfiles-setup
>>> /etc/conf.d/opentmpfiles-dev
--- /usr/
--- /usr/share/
--- /usr/share/doc/
>>> /usr/share/doc/opentmpfiles-0.1.3/
>>> /usr/share/doc/opentmpfiles-0.1.3/README.md.bz2
--- /bin/
>>> /bin/tmpfiles
 * Auto-adding 'opentmpfiles-dev' service to your sysinit runlevel
ln: failed to create symbolic link '/etc/runlevels/sysinit/opentmpfiles-dev': No such file or directory
 * Auto-adding 'opentmpfiles-setup' service to your boot runlevel
ln: failed to create symbolic link '/etc/runlevels/boot/opentmpfiles-setup': No such file or directory
>>> sys-apps/opentmpfiles-0.1.3 merged.
Comment 6 Ben Kohler gentoo-dev 2018-09-09 13:57:54 UTC
opentmpfiles maintainers: should the opentmpfiles ebuild "mkdir -p" those paths to allow runfile additions w/o depending directly on openrc?
Comment 7 Ben Kohler gentoo-dev 2018-09-19 16:59:31 UTC
As an example of a package handling this correctly, sys-apps/kmod does the following:

    # Add kmod to the runlevel automatically if this is the first install of this package.
    if [[ -z ${REPLACING_VERSIONS} ]]; then
        if [[ ! -d ${EROOT%/}/etc/runlevels/sysinit ]]; then
            mkdir -p "${EROOT%/}"/etc/runlevels/sysinit
        fi
        if [[ -x ${EROOT%/}/etc/init.d/kmod-static-nodes ]]; then
            ln -s /etc/init.d/kmod-static-nodes "${EROOT%/}"/etc/runlevels/sysinit/kmod-static-nodes
        fi
    fi
Comment 8 Larry the Git Cow gentoo-dev 2018-12-04 15:11:12 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e57f808ac2cdb22feb6c4ac856d71ff124c88dfd

commit e57f808ac2cdb22feb6c4ac856d71ff124c88dfd
Author:     William Hubbs <williamh@gentoo.org>
AuthorDate: 2018-12-04 15:06:28 +0000
Commit:     William Hubbs <williamh@gentoo.org>
CommitDate: 2018-12-04 15:10:39 +0000

    sys-apps/opentmpfiles: create runlevel directories if they do not exist
    
    Closes: https://bugs.gentoo.org/649480
    Package-Manager: Portage-2.3.51, Repoman-2.3.11
    Signed-off-by: William Hubbs <williamh@gentoo.org>

 sys-apps/opentmpfiles/opentmpfiles-0.2.ebuild  | 1 +
 sys-apps/opentmpfiles/opentmpfiles-9999.ebuild | 1 +
 2 files changed, 2 insertions(+)
Comment 9 Piotr Karbowski (RETIRED) gentoo-dev 2019-01-20 19:42:14 UTC
Hi,

I've just hit this bug again, I've used the 20190117T214502Z tarball of amd64 stage3 and the symlinks to opentmpfiles are not there. The commit that William made is on version 0.2 that is stable so the fix should be there.

I noticed that the original code William made is no more, now we have

pkg_postinst() {
	if [[ -z $REPLACING_VERSIONS ]]; then
		add_service opentmpfiles-dev sysinit
		add_service opentmpfiles-setup boot
	fi
}

which does not seems to work.