diff options
Diffstat (limited to 'sys-process/runit/files')
-rw-r--r-- | sys-process/runit/files/1-r1 (renamed from sys-process/runit/files/1-2.1.2) | 0 | ||||
-rw-r--r-- | sys-process/runit/files/1-r2 | 11 | ||||
-rw-r--r-- | sys-process/runit/files/1.openrc.example | 6 | ||||
-rw-r--r-- | sys-process/runit/files/2-r1 (renamed from sys-process/runit/files/2-2.1.2) | 0 | ||||
-rw-r--r-- | sys-process/runit/files/3-r1 (renamed from sys-process/runit/files/3-2.1.2) | 0 | ||||
-rw-r--r-- | sys-process/runit/files/3-r2 | 15 | ||||
-rw-r--r-- | sys-process/runit/files/3.openrc.example | 7 | ||||
-rw-r--r-- | sys-process/runit/files/rc.sh | 16 | ||||
-rw-r--r-- | sys-process/runit/files/run.getty (renamed from sys-process/runit/files/run.getty-2.1.2) | 0 |
9 files changed, 55 insertions, 0 deletions
diff --git a/sys-process/runit/files/1-2.1.2 b/sys-process/runit/files/1-r1 index 9761472ac739..9761472ac739 100644 --- a/sys-process/runit/files/1-2.1.2 +++ b/sys-process/runit/files/1-r1 diff --git a/sys-process/runit/files/1-r2 b/sys-process/runit/files/1-r2 new file mode 100644 index 000000000000..0ca4cc880e91 --- /dev/null +++ b/sys-process/runit/files/1-r2 @@ -0,0 +1,11 @@ +#!/bin/bash +# system one time tasks + +PATH=/sbin:/usr/sbin:/bin:/usr/bin + +. /etc/runit/rc.sh + +run_rc_stage 1 + +touch /etc/runit/stopit +chmod 0 /etc/runit/stopit diff --git a/sys-process/runit/files/1.openrc.example b/sys-process/runit/files/1.openrc.example new file mode 100644 index 000000000000..816c33d26372 --- /dev/null +++ b/sys-process/runit/files/1.openrc.example @@ -0,0 +1,6 @@ +#!/bin/sh + +# example script in stage 1 using openrc, sys-apps/openrc must be installed + +RUNLEVEL=S /sbin/openrc sysinit +RUNLEVEL=S /sbin/openrc boot diff --git a/sys-process/runit/files/2-2.1.2 b/sys-process/runit/files/2-r1 index a63a1b2d269d..a63a1b2d269d 100644 --- a/sys-process/runit/files/2-2.1.2 +++ b/sys-process/runit/files/2-r1 diff --git a/sys-process/runit/files/3-2.1.2 b/sys-process/runit/files/3-r1 index 30e602cdae96..30e602cdae96 100644 --- a/sys-process/runit/files/3-2.1.2 +++ b/sys-process/runit/files/3-r1 diff --git a/sys-process/runit/files/3-r2 b/sys-process/runit/files/3-r2 new file mode 100644 index 000000000000..0b757c01fe22 --- /dev/null +++ b/sys-process/runit/files/3-r2 @@ -0,0 +1,15 @@ +#!/bin/bash +exec >/dev/console 2>&1 +PATH=/sbin:/usr/sbin:/bin:/usr/bin + +echo 'Waiting for getties to stop...' +sv -w 10 force-shutdown /etc/service/getty-* + +echo 'Waiting for services to stop...' +sv -w 300 force-shutdown /etc/service/* + +echo 'Shutdown...' + +. /etc/runit/rc.sh + +run_rc_stage 3 diff --git a/sys-process/runit/files/3.openrc.example b/sys-process/runit/files/3.openrc.example new file mode 100644 index 000000000000..2e4cb44f08ef --- /dev/null +++ b/sys-process/runit/files/3.openrc.example @@ -0,0 +1,7 @@ +#!/bin/sh + +# example script in stage 3 using openrc, sys-apps/openrc must be installed + +test -x /etc/runit/reboot && LAST=6 || LAST=0 +test -x /etc/runit/reboot && RC=reboot || RC=shutdown +RUNLEVEL=$LAST /sbin/openrc $RC diff --git a/sys-process/runit/files/rc.sh b/sys-process/runit/files/rc.sh new file mode 100644 index 000000000000..6e382ff9b712 --- /dev/null +++ b/sys-process/runit/files/rc.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# run script(s) at /etc/runit/rc/, suffix must be .sh, prefix +# must be [1|3] which denote stage 1 or 3. +run_rc_stage() { + local prefix="${1}" + local prev_opt=$(shopt -p nullglob) + shopt -s nullglob + for file in /etc/runit/rc/"${prefix}".*.sh; do + if [[ ! -x "${file}" ]] || [[ ! -s "${file}" ]] ; then + continue + fi + . "${file}" + done + ${prev_opt} +} diff --git a/sys-process/runit/files/run.getty-2.1.2 b/sys-process/runit/files/run.getty index ab6f9543fe97..ab6f9543fe97 100644 --- a/sys-process/runit/files/run.getty-2.1.2 +++ b/sys-process/runit/files/run.getty |