summaryrefslogtreecommitdiff
path: root/system/sysvinit/inittab-2.88
diff options
context:
space:
mode:
authorLaurent Bercot <ska-adelie@skarnet.org>2019-05-28 16:49:42 +0000
committerLaurent Bercot <ska-adelie@skarnet.org>2019-05-28 16:49:42 +0000
commit0b82d071e1d6c87e54e38b8ff5ecd3fb1c5a0c6e (patch)
tree857bb98173718d5ac1ab9fae804cf11677547c55 /system/sysvinit/inittab-2.88
parent2f010c77dd84a08136edf3b38dd5974c6f0b750b (diff)
downloadpackages-0b82d071e1d6c87e54e38b8ff5ecd3fb1c5a0c6e.tar.gz
packages-0b82d071e1d6c87e54e38b8ff5ecd3fb1c5a0c6e.tar.bz2
packages-0b82d071e1d6c87e54e38b8ff5ecd3fb1c5a0c6e.tar.xz
packages-0b82d071e1d6c87e54e38b8ff5ecd3fb1c5a0c6e.zip
system/s6-linux-init: new package = new init system
This commit touches lots of things at once: it is necessary in order to maintain consistency. The impacted packages are: - s6-linux-init: new package. s6-linux-init mechanism plus booting policy. s6-linux-init conflicts with sysvinit; you can have one or the other, depending on what init you want to boot on. * s6-linux-init-common: subpackage of s6-linux-init, containing files used in the s6 supervision tree in both init cases. Both s6-linux-init and sysvinit depend on s6-linux-init-common. - s6: removed s6-svscanboot, which is policy, and only used in the sysvinit case. The s6 package is pure mechanism now. - utmps: adapted to the new location of the supervision tree, and reliable files provided by s6-linux-init-common. It works as is with both init systems. - gettys-openrc: had to move its invocation from "openrc sysinit" to "openrc default", because you can't make early gettys with s6-linux-init (no control over stage 1), and you can't have a supervision tree before sysinit with sysvinit (because /run is mounted very late, in boot), so the only solution that works with both is to make gettys late services. - sysvinit: now has s6-svscanboot (starting the s6 supervision tree from inittab), and a carefully crafted inittab that should work in all cases. Getting the right order of inittab lines was NOT easy, and I now hate sysvinit even more than I did before. Note that with the current version of apk, you cannot switch from sysvinit to s6-linux-init, or vice-versa, without an error. apk says files conflict. Because it adds the new files before removing the old ones. It should still work with apk -f, because the .apk-new mechanism makes it so that there's no real collision while you're switching, but it's still ugly as fuck and needs to be fixed in apk before we make the switch available to users.
Diffstat (limited to 'system/sysvinit/inittab-2.88')
-rw-r--r--system/sysvinit/inittab-2.8820
1 files changed, 13 insertions, 7 deletions
diff --git a/system/sysvinit/inittab-2.88 b/system/sysvinit/inittab-2.88
index e96205a06..f170042cf 100644
--- a/system/sysvinit/inittab-2.88
+++ b/system/sysvinit/inittab-2.88
@@ -16,30 +16,36 @@
# Default runlevel.
id:3:initdefault:
-# System initialization, mount local filesystems, etc.
+# Early system initialization.
si::sysinit:/sbin/openrc sysinit
-# Further system initialization, brings up the boot runlevel.
+# Further system initialization.
+# The distinction between sysinit and boot is totally arbitrary.
+# With the current OpenRC, sysinit does almost nothing and boot
+# does almost everything.
rc::bootwait:/sbin/openrc boot
+# Start the s6 supervision tree.
+s6:12345:respawn:/sbin/s6-svscanboot
+
+# Wait for the supervision tree to be operational before launching services.
+s6n:12345:wait:/bin/sh -c 'until test -s /run/s6_ready ; do sleep 1 ; done'
+
l0:0:wait:/sbin/openrc shutdown
-l0s:0:wait:/sbin/halt -hnp
+l0s:0:wait:/sbin/poweroff -df
l1:1:wait:/sbin/openrc single
l2:2:wait:/sbin/openrc nonetwork
l3:3:wait:/sbin/openrc default
l4:4:wait:/sbin/openrc default
l5:5:wait:/sbin/openrc default
l6:6:wait:/sbin/openrc reboot
-l6r:6:wait:/sbin/reboot -fin
+l6r:6:wait:/sbin/reboot -df
#z6:6:respawn:/sbin/sulogin
# new-style single-user
su0:S:wait:/sbin/openrc single
su1:S:wait:/sbin/sulogin
-# We now delegate all "respawn" services, including terminals, to s6.
-s6:12345:respawn:/lib/s6/s6-svscanboot
-
# What to do at the "Three Finger Salute".
ca:12345:ctrlaltdel:/sbin/shutdown -r now