From c2c14b525080203561d9e47d8a10442828342251 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Sat, 13 Jan 2018 14:33:25 +0000 Subject: Autogenerate final shutdown; rename rc.tini to rc.shutdown --- examples/rc.shutdown | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) (limited to 'examples/rc.shutdown') 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 -- cgit v1.3.1