From e98c4babea202d692a5dac8c05efc64a44e8aedc Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Tue, 19 Apr 2016 14:39:53 -0400 Subject: cause the grok-block hooks to run --- old-school/init.shutdown | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 old-school/init.shutdown (limited to 'old-school/init.shutdown') diff --git a/old-school/init.shutdown b/old-school/init.shutdown new file mode 100755 index 0000000..6bfce84 --- /dev/null +++ b/old-school/init.shutdown @@ -0,0 +1,30 @@ +#!/bin/sh +read omitpids < /run/sendsigs.omit.d/samizdat +for pid in $omitpids; do + if [ -e /proc/$pid/root ]; then + initroot=/proc/$pid/root + break + fi +done + +warn() { echo "$*" >/dev/console; } +error() { umount /sbin/init; exec /sbin/init; } + +[ -e "$initroot" ] || error + +if [ $$ != 1 ]; then + exec $initroot/init "$@" +else + set -- + for pid in $omitpids; do + set -- "$@" -o $pid + done + if killall5 -15 "$@"; then + sleep 5 + killall5 -9 "$@" + fi + exec <$initroot/dev/console >$initroot/dev/console 2>$initroot/dev/console + exec chroot $initroot umountall.sh + + error +fi -- cgit v1.2.3