diff options
author | Andrew Cady <d@jerkface.net> | 2016-04-19 14:39:53 -0400 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2016-04-19 14:39:53 -0400 |
commit | e98c4babea202d692a5dac8c05efc64a44e8aedc (patch) | |
tree | 033df22923a6b09b3395006ed4e2056afc281ff9 /old-school/init.shutdown | |
parent | 3884276c13d142483b1a018b31f5723e3961965f (diff) |
cause the grok-block hooks to run
Diffstat (limited to 'old-school/init.shutdown')
-rwxr-xr-x | old-school/init.shutdown | 30 |
1 files changed, 30 insertions, 0 deletions
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 @@ | |||
1 | #!/bin/sh | ||
2 | read omitpids < /run/sendsigs.omit.d/samizdat | ||
3 | for pid in $omitpids; do | ||
4 | if [ -e /proc/$pid/root ]; then | ||
5 | initroot=/proc/$pid/root | ||
6 | break | ||
7 | fi | ||
8 | done | ||
9 | |||
10 | warn() { echo "$*" >/dev/console; } | ||
11 | error() { umount /sbin/init; exec /sbin/init; } | ||
12 | |||
13 | [ -e "$initroot" ] || error | ||
14 | |||
15 | if [ $$ != 1 ]; then | ||
16 | exec $initroot/init "$@" | ||
17 | else | ||
18 | set -- | ||
19 | for pid in $omitpids; do | ||
20 | set -- "$@" -o $pid | ||
21 | done | ||
22 | if killall5 -15 "$@"; then | ||
23 | sleep 5 | ||
24 | killall5 -9 "$@" | ||
25 | fi | ||
26 | exec <$initroot/dev/console >$initroot/dev/console 2>$initroot/dev/console | ||
27 | exec chroot $initroot umountall.sh | ||
28 | |||
29 | error | ||
30 | fi | ||