summaryrefslogtreecommitdiff
path: root/system/s6-linux-init/reboot.sh
diff options
context:
space:
mode:
authorA. Wilcox <awilcox@wilcox-tech.com>2019-06-28 21:08:15 +0000
committerA. Wilcox <awilcox@wilcox-tech.com>2019-06-28 21:08:15 +0000
commit44424456f97d9fb1f8a4dc688a8e065e46c836d9 (patch)
treeab42d893b8d272f1b6be61c3dfd5b567d14c57c6 /system/s6-linux-init/reboot.sh
parent715edc6d997b0b7cd03029ca32a67cbb79727121 (diff)
parent0b82d071e1d6c87e54e38b8ff5ecd3fb1c5a0c6e (diff)
downloadpackages-44424456f97d9fb1f8a4dc688a8e065e46c836d9.tar.gz
packages-44424456f97d9fb1f8a4dc688a8e065e46c836d9.tar.bz2
packages-44424456f97d9fb1f8a4dc688a8e065e46c836d9.tar.xz
packages-44424456f97d9fb1f8a4dc688a8e065e46c836d9.zip
Merge branch 'skaware.20190515' into 'master'
skaware 2019-05-15 See merge request !234
Diffstat (limited to 'system/s6-linux-init/reboot.sh')
-rw-r--r--system/s6-linux-init/reboot.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/system/s6-linux-init/reboot.sh b/system/s6-linux-init/reboot.sh
new file mode 100644
index 000000000..d0d87aeb6
--- /dev/null
+++ b/system/s6-linux-init/reboot.sh
@@ -0,0 +1,21 @@
+#!/bin/sh -e
+
+# This script performs a "poor man's reboot" when the
+# init infrastructures are not there to do a proper one.
+# This is the case when the user *just* switched between
+# sysvinit and s6-linux-init, and needs to shut down the
+# old system but the shutdown binaries are the ones from
+# the new system.
+#
+# Always launch it from a console tty (tty1, ... tty6),
+# never from a network terminal or an xterm.
+
+trap "" INT HUP TERM
+mkdir -p -m 0755 /etc/runlevels/empty2
+/sbin/openrc empty2
+rmdir /etc/runlevels/empty2
+sync
+/etc/init.d/killprocs start
+/etc/init.d/savecache start
+/etc/init.d/mount-ro start
+/sbin/reboot -f