diff options
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | core-services/00-pseudofs.sh | 1 | ||||
-rw-r--r-- | functions | 4 | ||||
-rw-r--r-- | halt.8 | 4 | ||||
-rw-r--r-- | modules-load.8 | 4 | ||||
-rw-r--r-- | pause.1 | 4 | ||||
-rw-r--r-- | services/agetty-tty1/conf | 2 | ||||
-rwxr-xr-x | shutdown | 35 | ||||
-rw-r--r-- | shutdown.8 | 4 |
9 files changed, 32 insertions, 30 deletions
diff --git a/Makefile b/Makefile index 777326c..a21e5c9 100644 --- a/Makefile +++ b/Makefile @@ -38,8 +38,8 @@ install: install -m644 dracut/*.conf ${DESTDIR}/${PREFIX}/lib/dracut/dracut.conf.d ln -sf /run/runit/reboot ${DESTDIR}/etc/runit/ ln -sf /run/runit/stopit ${DESTDIR}/etc/runit/ - cp -aP runsvdir/* ${DESTDIR}/etc/runit/runsvdir/ - cp -aP services/* ${DESTDIR}/etc/sv/ + cp -R --no-dereference --preserve=mode,links -v runsvdir/* ${DESTDIR}/etc/runit/runsvdir/ + cp -R --no-dereference --preserve=mode,links -v services/* ${DESTDIR}/etc/sv/ clean: -rm -f halt pause diff --git a/core-services/00-pseudofs.sh b/core-services/00-pseudofs.sh index 3df155f..1ae7398 100644 --- a/core-services/00-pseudofs.sh +++ b/core-services/00-pseudofs.sh @@ -8,6 +8,7 @@ mountpoint -q /dev || mount -o mode=0755,nosuid -t devtmpfs dev /dev mkdir -p -m0755 /run/runit /run/lvm /run/user /run/lock /run/log /dev/pts /dev/shm mountpoint -q /dev/pts || mount -o mode=0620,gid=5,nosuid,noexec -n -t devpts devpts /dev/pts mountpoint -q /dev/shm || mount -o mode=1777,nosuid,nodev -n -t tmpfs shm /dev/shm +mountpoint -q /sys/kernel/security || mount -n -t securityfs securityfs /sys/kernel/security if [ -z "$VIRTUALIZATION" ]; then mountpoint -q /sys/fs/cgroup || mount -o mode=0755 -t tmpfs cgroup /sys/fs/cgroup diff --git a/functions b/functions index d1cd318..e0c37c8 100644 --- a/functions +++ b/functions @@ -49,7 +49,9 @@ deactivate_vgs() { deactivate_crypt() { if [ -x /sbin/dmsetup -o -x /bin/dmsetup ]; then msg "Deactivating Crypt Volumes" - dmsetup ls --target crypt --exec 'cryptsetup close' + for v in $(dmsetup ls --target crypt --exec "dmsetup info -c --noheadings -o open,name"); do + [ ${v%%:*} = "0" ] && cryptsetup close ${v##*:} + done deactivate_vgs "Crypt" fi } diff --git a/halt.8 b/halt.8 index f6fad42..8930ad3 100644 --- a/halt.8 +++ b/halt.8 @@ -63,5 +63,5 @@ to shut down network interfaces. .Xr init 8 , .Xr shutdown 8 .Sh AUTHOR -.An Christian Neukirchen , -.Mt chneukirchen@gmail.com . +.An Leah Neukirchen , +.Mt leah@vuxu.org . diff --git a/modules-load.8 b/modules-load.8 index 31441ec..40e2c9c 100644 --- a/modules-load.8 +++ b/modules-load.8 @@ -45,8 +45,8 @@ This program is a replacement for the utility provided by .Nm systemd . .Sh AUTHOR -.An Christian Neukirchen , -.Mt chneukirchen@gmail.com . +.An Leah Neukirchen , +.Mt leah@vuxu.org . .Sh LICENSE .Nm is in the public domain. diff --git a/pause.1 b/pause.1 index e4f9997..1e56f20 100644 --- a/pause.1 +++ b/pause.1 @@ -35,5 +35,5 @@ ip link set eth0 down .Xr sleep 1 , .Xr pause 2 .Sh AUTHOR -.An Christian Neukirchen , -.Mt chneukirchen@gmail.com . +.An Leah Neukirchen , +.Mt leah@vuxu.org . diff --git a/services/agetty-tty1/conf b/services/agetty-tty1/conf index fee6d06..b9b33c2 100644 --- a/services/agetty-tty1/conf +++ b/services/agetty-tty1/conf @@ -1,4 +1,4 @@ -if [ -x /sbin/agetty -o /bin/agetty ]; then +if [ -x /sbin/agetty -o -x /bin/agetty ]; then # util-linux specific settings if [ "${tty}" = "tty1" ]; then GETTY_ARGS="--noclear" diff --git a/shutdown b/shutdown index b456647..9b6bba4 100755 --- a/shutdown +++ b/shutdown @@ -6,7 +6,7 @@ single() { } abort() { - echo "$@" >&2 + printf '%s\n' "$1" >&2 exit 1 } @@ -37,7 +37,10 @@ time=$1; shift message="${*:-system is going down}" if [ "$action" = "cancel" ]; then - kill $(cat /run/runit/shutdown.pid) + kill "$(cat /run/runit/shutdown.pid)" + if [ -e /etc/nologin ] && ! [ -s /etc/nologin ]; then + rm /etc/nologin + fi echo "${*:-shutdown cancelled}" | wall exit fi @@ -52,23 +55,19 @@ case "$time" in *) abort "invalid time";; esac -if [ "$time" -gt 5 ]; then - echo "$message in $time minutes" | wall - printf "shutdown: sleeping for $time minutes... " - sleep $(((time - 5) * 60)) - printf "\n" - time=5 -fi +for break in 5 0; do + [ "$time" -gt "$break" ] || continue + [ "$break" = 0 ] && touch /etc/nologin -if [ "$time" -gt 0 ]; then - echo "$message in $time minutes" | wall - touch /etc/nologin - printf "shutdown: sleeping for $time minutes... " - sleep $((time * 60)) - printf "\n" - rm /etc/nologin -fi + printf '%s in %s minutes\n' "$message" "$time" | wall + printf 'shutdown: sleeping for %s minutes... ' "$(( time - break ))" + sleep $(( (time - break) * 60 )) + time="$break" + printf '\n' + + [ "$break" = 0 ] && rm /etc/nologin +done -echo "$message NOW" | wall +printf '%s NOW\n' "$message" | wall $action diff --git a/shutdown.8 b/shutdown.8 index 021cd62..4547e5b 100644 --- a/shutdown.8 +++ b/shutdown.8 @@ -86,5 +86,5 @@ Turn off the system: .Xr runit 8 , .Xr runsvchdir 8 .Sh AUTHOR -.An Christian Neukirchen , -.Mt chneukirchen@gmail.com . +.An Leah Neukirchen , +.Mt leah@vuxu.org . |