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

Bug 935656

Summary: sys-process/runit: /sbin/runsvdir-start symlink broken with merged-usr
Product: Gentoo Linux Reporter: Artemis Everfree <artemis>
Component: Current packagesAssignee: Zhixu Liu <zhixu.liu>
Status: RESOLVED FIXED    
Severity: normal CC: artemis, base-system, proxy-maint
Priority: Normal Keywords: PATCH, PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/gentoo/gentoo/pull/38531
https://bugs.gentoo.org/show_bug.cgi?id=904989
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 690294    
Attachments: patch to change `../etc` to `/etc` for the runsvdir-start symlink

Description Artemis Everfree 2024-07-06 06:48:36 UTC
sys-process/runit provides the following symlink:

/sbin/runsvdir-start -> ../etc/runit/2

This symlink is intended for use with inittab to launch runit as a secondary service manager ( https://wiki.gentoo.org/wiki/Runit#From_sysvinit ), i.e.

SV:12345:respawn:/sbin/runsvdir-start

With split-usr this works as intended, and resolves to /etc/runit/2 when ROOT=/. With merged-usr, /sbin is a symlink to /usr/bin. So this link resolves to /usr/etc/runit/2, breaking the link.

Reproducible: Always
Comment 1 Artemis Everfree 2024-07-06 09:18:38 UTC
forgot to mention- version 2.1.2-r2
Comment 2 Artemis Everfree 2024-07-07 07:46:20 UTC
Created attachment 897254 [details, diff]
patch to change `../etc` to `/etc` for the runsvdir-start symlink

Changing the symlink to be an absolute link instead of relative might be the right fix for this.

It does mean the link would point to the wrong file when viewed with the rootfs mounted somewhere other than `/`. i.e. outside a chroot, in a prefix or crossdev. However, it's unlikely that someone would want to execute this file in those contexts.

If we want to keep the symlink relative, I think we would need to add an IUSE=split-usr

I don't feel strongly about either solution. I've attached a patch that implements the absolute link change, which is what I'm using on my system right now.
Comment 3 Larry the Git Cow gentoo-dev 2024-10-07 15:33:04 UTC
The bug has been closed via the following commit(s):

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

commit cb893880b4741d78a58b005a005985bbf7dc0dd8
Author:     Z. Liu <zhixu.liu@gmail.com>
AuthorDate: 2024-09-09 08:55:05 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2024-10-07 15:31:02 +0000

    sys-process/runit: fix path issue
    
    1. install binary to /usr (remove 'into /')
    2. handle symlink of /sbin/runsvdir-start by USE split-usr
    
    Closes: https://bugs.gentoo.org/904989
    Closes: https://bugs.gentoo.org/935656
    Signed-off-by: Z. Liu <zhixu.liu@gmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/38531
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 .../runit/{runit-2.1.2-r5.ebuild => runit-2.1.2-r6.ebuild}    | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)