summaryrefslogtreecommitdiff
path: root/s6/skel
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-03-01 22:01:26 +0000
committerdavidovski <david@davidovski.xyz>2022-03-01 22:01:26 +0000
commitefee4ebf43e376a7cd8b8abcef0c70aa90427bb4 (patch)
tree13956b6dbca8622b71edbdd3a1c2a949c5d1aac8 /s6/skel
initial commit
Diffstat (limited to 's6/skel')
-rw-r--r--s6/skel/rc.init9
-rw-r--r--s6/skel/rc.shutdown3
-rw-r--r--s6/skel/rc.shutdown.final18
-rw-r--r--s6/skel/runlevel5
4 files changed, 35 insertions, 0 deletions
diff --git a/s6/skel/rc.init b/s6/skel/rc.init
new file mode 100644
index 0000000..b467448
--- /dev/null
+++ b/s6/skel/rc.init
@@ -0,0 +1,9 @@
+#!/bin/sh -e
+
+rl="$1"
+shift
+
+s6-rc-init -c /etc/s6/db/current /run/service
+
+exec /etc/s6/base/scripts/runlevel "$rl"
+
diff --git a/s6/skel/rc.shutdown b/s6/skel/rc.shutdown
new file mode 100644
index 0000000..bc5771d
--- /dev/null
+++ b/s6/skel/rc.shutdown
@@ -0,0 +1,3 @@
+#!/bin/sh -e
+
+exec s6-rc -bda change
diff --git a/s6/skel/rc.shutdown.final b/s6/skel/rc.shutdown.final
new file mode 100644
index 0000000..3f46b87
--- /dev/null
+++ b/s6/skel/rc.shutdown.final
@@ -0,0 +1,18 @@
+#!/bin/sh -e
+
+### Things to do *right before* the machine gets rebooted or
+### powered off, at the very end of the shutdown sequence,
+### when all the filesystems are unmounted.
+
+### This is a last resort hook; normally nothing should be
+### done here (your rc.shutdown script should have taken care
+### of everything) and you should leave this script empty.
+
+### Some distributions, however, may need to perform some
+### actions after unmounting the filesystems: typically if
+### an additional teardown action is required on a filesystem
+### after unmounting it, or if the system needs to be
+### pivot_rooted before it can be shut down, etc.
+
+### Those are all exceptional cases. If you don't know for
+### certain that you need to do something here, you don't.
diff --git a/s6/skel/runlevel b/s6/skel/runlevel
new file mode 100644
index 0000000..f9db6e4
--- /dev/null
+++ b/s6/skel/runlevel
@@ -0,0 +1,5 @@
+#!/bin/sh -e
+
+test "$#" -gt 0 || { echo 'runlevel: fatal: too few arguments' 1>&2 ; exit 100 ; }
+
+exec s6-rc -up change "$1"