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

Bug 642858

Summary: sys-apps/sysvinit should re-execute itself at shutdown
Product: Gentoo Linux Reporter: Mike Gilbert <floppym>
Component: Current packagesAssignee: William Hubbs <williamh>
Status: RESOLVED FIXED    
Severity: normal CC: base-system, openrc
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=499662
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 642784    
Attachments: init script
init script v2
call telinit u from inittab

Description Mike Gilbert gentoo-dev 2017-12-31 16:54:34 UTC
As discussed on bug 642784, PID 1 (init) may hold open references to files which have been unlinked. These references may cause unmounting/remounting of filesystems to fail.

OpenRC should cause PID 1 to re-execute itself on shutdown to avoid this problem. This may generally be accomplished by calling "telinit u".
Comment 1 Mike Gilbert gentoo-dev 2018-01-02 17:29:27 UTC
Created attachment 512870 [details]
init script

Here's an init script that should get the job done. This should be added to the "boot" runlevel in pkg_postinst.
Comment 2 Mike Gilbert gentoo-dev 2018-01-02 18:06:13 UTC
Created attachment 512872 [details]
init script v2

Alternate init script, should be added to the 'shutdown' runlevel.
Comment 3 Mike Gilbert gentoo-dev 2018-10-28 19:25:20 UTC
Created attachment 553548 [details, diff]
call telinit u from inittab

Here's another alternative that calls telinit u from inittab for the relevant runlevels.
Comment 4 Larry the Git Cow gentoo-dev 2018-10-31 14:10:42 UTC
The bug has been closed via the following commit(s):

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

commit d91617e997cdde5eb4c1fba797fdcb221dcbbd8a
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2018-10-28 19:12:43 +0000
Commit:     William Hubbs <williamh@gentoo.org>
CommitDate: 2018-10-31 14:10:03 +0000

    sys-apps/sysvinit: call telinit u when halting or rebooting
    
    Closes: https://bugs.gentoo.org/642858
    Package-Manager: Portage-2.3.51_p2, Repoman-2.3.11_p27
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>
    Signed-off-by: William Hubbs <williamh@gentoo.org>

 sys-apps/sysvinit/files/inittab-2.91      |  61 ++++++++++++++++
 sys-apps/sysvinit/sysvinit-2.91-r1.ebuild | 117 ++++++++++++++++++++++++++++++
 2 files changed, 178 insertions(+)