about summary refs log tree commit diff
path: root/2
diff options
context:
space:
mode:
authorJuan RP <xtraeme@gmail.com>2014-04-25 23:20:32 +0200
committerJuan RP <xtraeme@gmail.com>2014-04-25 23:20:32 +0200
commitb2fec086b9f498102537e0ff936138b2960e4082 (patch)
tree13dd068d53033bf799a502fff1acbf46dfe0743c /2
downloadrunit-void-b2fec086b9f498102537e0ff936138b2960e4082.tar.gz
runit-void-b2fec086b9f498102537e0ff936138b2960e4082.tar.xz
runit-void-b2fec086b9f498102537e0ff936138b2960e4082.zip
Initial import of runit init scripts based on ignite.
I did not use ignite because it needs bash, and I don't really want it.
Diffstat (limited to '2')
-rwxr-xr-x224
1 files changed, 24 insertions, 0 deletions
diff --git a/2 b/2
new file mode 100755
index 0000000..c793759
--- /dev/null
+++ b/2
@@ -0,0 +1,24 @@
+#!/bin/sh
+# vim: set ts=4 sw=4 et:
+
+PATH=/usr/bin:/usr/sbin
+
+runlevel=default
+for arg in $(cat /proc/cmdline); do
+    case $arg in
+        single) echo "Initializing single user mode..."; runlevel=single;;
+    esac
+done
+
+# Setup first tty as unicode again, stage1 does not work correctly for tty1.
+unicode_start
+
+# Create runlevel and then copy services.
+if [ -d /etc/runit/runsvdir/${runlevel} ]; then
+    mkdir -p /run/runit/runsvdir
+    cp -aP /etc/runit/runsvdir/${runlevel} /run/runit/runsvdir
+    ln -s /run/runit/runsvdir/${runlevel} /run/runit/runsvdir/current
+fi
+
+exec env - PATH=$PATH \
+    runsvdir -P /run/runit/runsvdir/current 'log: ...........................................................................................................................................................................................................................................................................................................................................................................................................'