diff --git a/modules/system/upstart-events/halt.nix b/modules/system/upstart-events/halt.nix index 60727e3686b..82b5ffcae1a 100644 --- a/modules/system/upstart-events/halt.nix +++ b/modules/system/upstart-events/halt.nix @@ -69,7 +69,12 @@ let for mp in $(getMountPoints); do device=$(getDevice $mp) echo "unmounting $mp..." - if umount -f -n "$mp"; then + # !!! Don't unmount /nix/store or /hostfs. This is + # a quick hack to cleanly shutdown VMs that mount + # the Nix store via CIFS. "mount -f" will actually + # work on such filesystems, which makes all commands + # needed below disappear. + if test "$mp" != /nix/store -a "$mp" != /hostfs && umount -f -n "$mp"; then if test "$mp" != /; then tryAgain=1; fi else mount -n -o remount,ro "$mp" || true diff --git a/modules/tasks/network-interfaces.nix b/modules/tasks/network-interfaces.nix index 4c57b48bd94..d075d04ed6b 100644 --- a/modules/tasks/network-interfaces.nix +++ b/modules/tasks/network-interfaces.nix @@ -159,10 +159,10 @@ in respawn sleep 100000 stop script - for i in $(cd /sys/class/net && ls -d *); do - echo "Taking down network device $i..." - ${nettools}/sbin/ifconfig $i down || true - done + #for i in $(cd /sys/class/net && ls -d *); do + # echo "Taking down network device $i..." + # ${nettools}/sbin/ifconfig $i down || true + #done end script ''; }];