Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 642858 - sys-apps/sysvinit should re-execute itself at shutdown
Summary: sys-apps/sysvinit should re-execute itself at shutdown
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: William Hubbs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 642784
  Show dependency tree
 
Reported: 2017-12-31 16:54 UTC by Mike Gilbert
Modified: 2024-02-17 06:28 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
init script (sysvinit-reexec,292 bytes, text/plain)
2018-01-02 17:29 UTC, Mike Gilbert
Details
init script v2 (sysvinit-reexec,292 bytes, text/plain)
2018-01-02 18:06 UTC, Mike Gilbert
Details
call telinit u from inittab (bug642858-call-telinit-u.patch,6.48 KB, patch)
2018-10-28 19:25 UTC, Mike Gilbert
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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(+)