Files
linuxkit/pkg/init/bin/rc.shutdown
Justin Cormack cb2ca4ef66 Switch runc and containerd startup to be entirely Go
At present they use a small shared function called "prepare"
that does the read-write remounts, that I will switch to doing overlay
mounts soon.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-07-26 16:32:09 +01:00

21 lines
400 B
Bash
Executable File

#!/bin/sh
# execute other shutdown processes
SHUTS="$(find /etc/shutdown.d ! -type d 2>/dev/null | sort)"
for f in $SHUTS
do
$f
done
# kill all processes and unmount filesystems
/usr/sbin/killall5 -15
/bin/sleep 5
/usr/sbin/killall5 -9
/sbin/swapoff -a
/bin/echo "Unmounting filesystems"
/bin/umount -a -r
# shutdown or reboot
[ "$1" = "reboot" ] && exec /sbin/reboot -f
/sbin/poweroff -f