--- rc.shutdown.orig 2010-03-16 12:34:25.676720819 +0100 +++ rc.shutdown 2010-03-18 19:08:16.039130467 +0100 @@ -102,6 +106,39 @@ /bin/umount -a -r -t noramfs,notmpfs,nosysfs,noproc -O no_netdev stat_done +stat_busy "Remounting Root Filesystem Read-only" +/bin/mount -n -o remount,ro / +stat_done + +if [ "$SHUTDOWN_FSCK" = "yes" -o "$SHUTDOWN_FSCK" = "YES" ]; then + FORCEFSCK= + [ -f /forcefsck ] && FORCEFSCK="-- -f" + NETFS="nonfs,nonfs4,nosmbfs,nocifs,nocodafs,noncpfs,nosysfs,noshfs,nofuse,nofuseblk,noglusterfs" + if [ -x /sbin/fsck ]; then + stat_busy "Checking Filesystems" + FSCK_OUT=/dev/stdout + FSCK_ERR=/dev/null + /sbin/fsck -A -T -C -a -t $NETFS $FORCEFSCK >$FSCK_OUT 2>$FSCK_ERR + fsckret=$? + if [ ${fsckret} -gt 1 ]; then + stat_fail + fi + if [ ${fsckret} -gt 1 -a ${fsckret} -ne 32 ]; then + echo + echo "***************** FILESYSTEM CHECK FAILED ****************" + echo "* *" + echo "* The filesystem will be checked again on the next boot. *" + echo "* If the error persists, you'll be given a chance to fix *" + echo "* the problem manually. *" + echo "* *" + echo "************************************************************" + echo + sleep 20m + fi + stat_done + fi +fi + # Kill non-root encrypted partition mappings if [ -f /etc/crypttab -a -n "$(/bin/grep -v ^# /etc/crypttab | /bin/grep -v ^$)" ]; then stat_busy "Deactivating encrypted volumes:" @@ -133,10 +170,6 @@ fi fi -stat_busy "Remounting Root Filesystem Read-only" -/bin/mount -n -o remount,ro / -stat_done - run_hook shutdown_poweroff # Power off or reboot