From 23cc979f61882cd2fc75758e0419a4cde4666b81 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 8 Jun 2010 10:06:00 +0000 Subject: [PATCH] * Run `swapoff -a' during shutdown. Otherwise filesystems containing swapfiles cannot be unmounted or even remounted read-only. * In the remount, pass `-t none' to get a more informative error message if the filesystem is in use. svn path=/nixos/branches/boot-order/; revision=22179 --- modules/system/upstart-events/shutdown.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/system/upstart-events/shutdown.nix b/modules/system/upstart-events/shutdown.nix index 9db5fafa46c..368886a6302 100644 --- a/modules/system/upstart-events/shutdown.nix +++ b/modules/system/upstart-events/shutdown.nix @@ -63,6 +63,10 @@ with pkgs.lib; # Set the hardware clock to the system time. echo "setting the hardware clock..." hwclock --systohc --utc + + + # Stop all swap devices. + swapoff -a # Unmount helper functions. @@ -99,7 +103,7 @@ with pkgs.lib; # `-i' is to workaround a bug in mount.cifs (it # doesn't recognise the `remount' option, and # instead mounts the FS again). - mount -n -i -o remount,ro "$mp" + mount -t none -n -i -o remount,ro none "$mp" # Note: don't use `umount -f'; it's very buggy. # (For instance, when applied to a bind-mount it @@ -118,8 +122,8 @@ with pkgs.lib; fi done done - - + + # Final sync. sync