From a17b1d5c5f47b5ee1a945fe7705adf1a64ac6f7c Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 20 Feb 2007 15:51:13 +0000 Subject: [PATCH] * Kill all processes during shutdown so that we can unmount filesystems cleanly. svn path=/nixos/trunk/; revision=7930 --- upstart-jobs/halt.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/upstart-jobs/halt.nix b/upstart-jobs/halt.nix index ce23e967e8bf..4da444774a2c 100644 --- a/upstart-jobs/halt.nix +++ b/upstart-jobs/halt.nix @@ -19,9 +19,22 @@ script export PATH=${utillinux}/bin:${utillinux}/sbin:$PATH + # Do an initial sync just in case. sync || true + + # Kill all remaining processes except init and this one. + echo \"Sending the TERM signal to all processes...\" + kill -TERM -1 + + sleep 1 # wait briefly + + echo \"Sending the KILL signal to all processes...\" + kill -KILL -1 + + + # Unmount helper functions. getMountPoints() { cat /proc/mounts \\ | grep -v '^rootfs' \\