2006-11-20 21:50:52 +01:00
|
|
|
{bash}:
|
|
|
|
|
|
|
|
{
|
|
|
|
name = "sys-halt";
|
|
|
|
|
|
|
|
job = "
|
|
|
|
start on reboot
|
|
|
|
start on halt
|
|
|
|
start on system-halt
|
|
|
|
start on power-off
|
|
|
|
|
|
|
|
script
|
|
|
|
exec < /dev/tty1 > /dev/tty1 2>&1
|
|
|
|
echo \"\"
|
|
|
|
echo \"<<< SYSTEM SHUTDOWN >>>\"
|
|
|
|
echo \"\"
|
|
|
|
|
2006-11-20 22:19:34 +01:00
|
|
|
# Do an initial sync just in case.
|
|
|
|
sync || true
|
|
|
|
|
|
|
|
# Unmount file systems.
|
|
|
|
umount -n -a || true
|
|
|
|
|
|
|
|
# Remount / read-only
|
|
|
|
mount -n -o remount,ro /dontcare / || true
|
|
|
|
|
|
|
|
# Final sync.
|
|
|
|
sync || true
|
|
|
|
|
2006-11-20 21:50:52 +01:00
|
|
|
# Right now all events above power off the system.
|
2006-11-20 22:20:04 +01:00
|
|
|
exec halt -f -p
|
2006-11-20 21:50:52 +01:00
|
|
|
end script
|
|
|
|
";
|
|
|
|
|
|
|
|
}
|