summaryrefslogtreecommitdiff
path: root/examples/rc.init
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-07-17 13:31:20 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-07-17 13:31:20 +0000
commit17c03cf8f0a6339d78ad8fb968ef3b999d658034 (patch)
treee9c5d8596ebe30216d916943fb7ef8c99ad7f0c6 /examples/rc.init
parent602e835f5afd57cc8659e78f28034e1a2d362248 (diff)
downloads6-linux-init-17c03cf8f0a6339d78ad8fb968ef3b999d658034.tar.xz
Import /etc/rc.[init tini shutdown] examples from lh-bootstrap
Diffstat (limited to 'examples/rc.init')
-rwxr-xr-xexamples/rc.init25
1 files changed, 24 insertions, 1 deletions
diff --git a/examples/rc.init b/examples/rc.init
index e0b2b72..d71fd1a 100755
--- a/examples/rc.init
+++ b/examples/rc.init
@@ -1,4 +1,27 @@
#!/bin/execlineb -P
+
+# Make sure the /dev/urandom entropy pool will be set in
+# a not-too-distant future. Ideally we'd block on this,
+# but it's not critical, so we don't.
+
+background -d { s6-fillurandompool }
+
+
+# Set the system clock to something sensible,
+# to get coherent logs until the initial NTP message
+
+if { s6-clock @40000000596c000000000000 }
+
+
+# Initialize the service manager
+
if { s6-rc-init /run/service }
-s6-rc -u change ok-all
+
+
+# Run the service manager.
+# Call it twice because the first time may spuriously "timeout"
+# due to the clock jumping forward.
+
+if -nt { s6-rc -t 600000 -- change ok-all }
+s6-rc -t 600000 -- change ok-all