diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2018-01-13 14:33:25 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2018-01-13 14:33:25 +0000 |
commit | c2c14b525080203561d9e47d8a10442828342251 (patch) | |
tree | 11b5145ae7413ef577ad190315bfa147c23057c6 /examples/rc.shutdown | |
parent | 1bd507eda34de6945c18daa916fb64ad810fda5a (diff) | |
download | s6-linux-init-c2c14b525080203561d9e47d8a10442828342251.tar.xz |
Autogenerate final shutdown; rename rc.tini to rc.shutdown
Diffstat (limited to 'examples/rc.shutdown')
-rwxr-xr-x | examples/rc.shutdown | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/examples/rc.shutdown b/examples/rc.shutdown index 04d7357..14b4692 100755 --- a/examples/rc.shutdown +++ b/examples/rc.shutdown @@ -1,20 +1,16 @@ -#!/bin/execlineb -S0 +#!/bin/execlineb -P -foreground { s6-echo "Giving dying processes some grace time." } -foreground { s6-sleep 2 } -foreground { s6-echo "Syncing disks." } -foreground { s6-sync } -foreground { s6-echo "Sending all processes the TERM signal." } -foreground { s6-nuke -th } -foreground { s6-sleep 2 } -foreground { s6-echo "Sending all processes the KILL signal." } -foreground { s6-nuke -k } -wait { } -foreground { s6-echo "Syncing and unmounting disks." } -foreground { s6-sync } -foreground { s6-umount -a } -foreground { s6-mount -ro remount /dev/root / } +# Write a message to /var/log/syslogd -foreground { s6-echo "\nPerforming "${1}"." } -s6-${1} -f +foreground +{ + s6-ipcclient -l0 /dev/log + fdmove 1 7 + s6-echo "/etc/rc.shutdown: shutdown requested" +} + + +# Shut down all services + +s6-rc -da change |