summaryrefslogtreecommitdiff
path: root/examples/ROOT/etc
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2015-10-06 16:23:19 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2015-10-06 16:23:19 +0000
commit4da6b9c320e6b49d38af5cb6b5861480141f24cd (patch)
treec920b72f5f291a29a71ca009ce113e4846b8a217 /examples/ROOT/etc
parent478dd24279f833042a94590df0726d163b576af5 (diff)
downloads6-4da6b9c320e6b49d38af5cb6b5861480141f24cd.tar.xz
- add -s support to s6-svscan
- change examples to support -s - change examples to invoke s6-rc, remove servicedirs
Diffstat (limited to 'examples/ROOT/etc')
-rwxr-xr-xexamples/ROOT/etc/s6-init/crash13
-rwxr-xr-xexamples/ROOT/etc/s6-init/init-stage12
-rwxr-xr-xexamples/ROOT/etc/s6-init/init-stage220
-rwxr-xr-xexamples/ROOT/etc/s6-init/init-stage32
-rwxr-xr-xexamples/ROOT/etc/s6-init/network-config5
-rw-r--r--examples/ROOT/etc/s6-rc/README9
6 files changed, 14 insertions, 37 deletions
diff --git a/examples/ROOT/etc/s6-init/crash b/examples/ROOT/etc/s6-init/crash
deleted file mode 100755
index 501e316..0000000
--- a/examples/ROOT/etc/s6-init/crash
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/command/execlineb -P
-
-# This file is run when an unrecoverable error happens
-# to s6-svscan. Edit it to suit your needs.
-
-cd /
-redirfd -r 0 /dev/console
-redirfd -w 1 /dev/console
-fdmove -c 2 1
-
-foreground { s6-echo "s6-svscan panicked! Dropping to a root shell.\n" }
-
-/bin/sh -i
diff --git a/examples/ROOT/etc/s6-init/init-stage1 b/examples/ROOT/etc/s6-init/init-stage1
index a06b015..810948b 100755
--- a/examples/ROOT/etc/s6-init/init-stage1
+++ b/examples/ROOT/etc/s6-init/init-stage1
@@ -56,4 +56,4 @@ background
unexport !
# Start stage 2.
-s6-svscan -t0 /service
+s6-svscan -st0 /service
diff --git a/examples/ROOT/etc/s6-init/init-stage2 b/examples/ROOT/etc/s6-init/init-stage2
index 58ac98d..86f31a5 100755
--- a/examples/ROOT/etc/s6-init/init-stage2
+++ b/examples/ROOT/etc/s6-init/init-stage2
@@ -4,7 +4,6 @@
# starts. It should perform all the remaining one-time initialization
# tasks.
-
if -nt
{
@@ -12,22 +11,9 @@ if -nt
# NOT on /dev/console !
if { s6-echo "* init-stage2 starting." }
-# Call your one-time early initialization scripts (before bringing
-# the network up) here:
-# set the hostname, mount filesystems, adjust sysctls, etc.
-# if { s6-mount -wt devpts -o noexec,nosuid,gid=0,mode=0600 devpts /dev/pts }
-# if { s6-mount -wt ext4 /dev/sda3 /mnt/rwfs }
-
-# Start the local services
- if { s6-hiercopy /img/services-local /service }
- if { s6-svscanctl -a /service }
-
-# Bring up the network
- if { /etc/s6-init/network-config }
-
-# Start the late services
- if { s6-hiercopy /img/services-network /service }
- if { s6-svscanctl -a /service }
+# Call your service manager commands here to run the boot scripts.
+ if { s6-rc-init /service }
+ if { s6-rc -u change normal-state }
# We're done and the machine is fully operational.
s6-echo "* init-stage2 completed."
diff --git a/examples/ROOT/etc/s6-init/init-stage3 b/examples/ROOT/etc/s6-init/init-stage3
index 66b3062..ff28372 100755
--- a/examples/ROOT/etc/s6-init/init-stage3
+++ b/examples/ROOT/etc/s6-init/init-stage3
@@ -13,7 +13,7 @@ foreground { s6-echo "Syncing disks." }
foreground { s6-sync }
-# Even if s6-svscan properly brought all the services down
+# Even if s6-rc and s6-svscan properly brought all the services down
# before exec'ing into this script, users might have launched
# background nohup processes, so we have to kill everything.
diff --git a/examples/ROOT/etc/s6-init/network-config b/examples/ROOT/etc/s6-init/network-config
deleted file mode 100755
index 2f9e3cd..0000000
--- a/examples/ROOT/etc/s6-init/network-config
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/command/execlineb -P
-
-# if { ifconfig lo 127.0.0.1 netmask 255.0.0.0 }
-
-# Configure your network interfaces and routing here.
diff --git a/examples/ROOT/etc/s6-rc/README b/examples/ROOT/etc/s6-rc/README
new file mode 100644
index 0000000..959f280
--- /dev/null
+++ b/examples/ROOT/etc/s6-rc/README
@@ -0,0 +1,9 @@
+ If you are using s6-rc as your service manager, this directory should
+be the place where you store your compiled service databases.
+
+ The /etc/s6-init/init-stage2 script invokes s6-rc which expects to
+find its data here by default.
+
+ The /run/service/.s6-svscan/SIG{INT,USR1,USR2} scripts invoke
+s6-rc to bring down all the managed services before shutting down
+s6-svscan.