anchor.diff:                    # /etc/mtab).
                     if echo "$device" | grep -q '/dev/loop'; then
                         echo "removing loop device $device..."
  -                      losetup -d "$device" || true
  +                      losetup -d "$device"
                     fi
                 done
             done
         
  -          cat /proc/mounts
  -      
         
             # Final sync.
  -          sync || true
  +          sync
         
         
             # Either reboot or power-off the system.  Note that the "halt"
             # event also does a power-off.
             if test ${event} = reboot; then
  +              echo "rebooting..."
  +              sleep 1
                 exec reboot -f
             else
  +              echo "powering off..."
  +              sleep 1
                 exec halt -f -p
             fi
         
  
positive.code:               for mp in $(getMountPoints); do
                    device=$(getDevice $mp)
                    echo "unmounting $mp..."
                    # !!! 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
                    fi
        
                    # Hack: work around a bug in mount (mount -o remount on a
  
negative.code:       
        
            # Set the hardware clock to the system time.
            echo "setting the hardware clock..."
            hwclock --systohc --utc
        
        
            # Do an initial sync just in case.
            sync
        
        
            # 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.
  