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

Bug 524404

Summary: sys-apps/sysvinit - add support for root unmounting
Product: Gentoo Linux Reporter: i.Dark_Templar <idarktemplar>
Component: [OLD] Core systemAssignee: Gentoo's Team for Core System packages <base-system>
Status: UNCONFIRMED ---    
Severity: normal CC: idarktemplar, ole+gentoo
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
URL: http://savannah.nongnu.org/bugs/?33517
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: sysvinit-exec.patch
sysvinit-data.tar.bz2

Description i.Dark_Templar 2014-10-03 20:14:47 UTC
There is a feature request at sysvinit bugzilla for root unmounting support.

Reproducible: Always
Comment 1 i.Dark_Templar 2014-10-03 20:16:12 UTC
Created attachment 386004 [details, diff]
sysvinit-exec.patch
Comment 2 i.Dark_Templar 2014-10-03 20:17:27 UTC
Created attachment 386006 [details]
sysvinit-data.tar.bz2
Comment 3 i.Dark_Templar 2014-10-03 20:25:18 UTC
I've also mailed attached patches and scripts to sysvinit-devel mail list, but it looks dead:
http://lists.nongnu.org/archive/html/sysvinit-devel/2014-06/msg00000.html

Patch is slightly different from the one attached to the mail, it has different file names. Patch attached to this bug is modified to be accepted when it's put to "/etc/portage/patches/sys-apps/sysvinit" directory.

Attached scripts just unmount root and proceed to powering off or rebooting system. For debugging purposes interactive shell is started right before reboot/poweroff. Just exit from it to continue to rebooting/powering off. Scripts are just an example, proof-of-concept, but they may be used for implementing further features, like shutting down encrypted tomes or lvm or anything else. Scripts require statically-linked busybox in order to work and they assume that they are put into directory "/usr/local/sbin".

WARNING: I've tested scripts at VM and they worked fine for me, but for your data safety read them first and try them on spare VM first.
Comment 4 Mike Gilbert gentoo-dev 2014-10-03 23:21:54 UTC
Seems like a nice feature to me. systemd is already capable of doing this, but it might be useful for those that prefer to stick with the old init/openrc.

I would suggest adding some documentation to the inittab.5 manpage.
Comment 5 Mike Gilbert gentoo-dev 2014-10-03 23:24:27 UTC
Also, a better summary for this bug would be "Allow replacement of PID 1 via exec action in inittab".