From 2b35036a6089e4a0195872a2c05543e597c59a8c Mon Sep 17 00:00:00 2001 From: Kurt J. Bosch Date: Sun, 21 Mar 2010 11:47:55 +0100 Subject: [PATCH 5/5] Add fsck_loop to rc.shutdown for completeness --- rc.shutdown | 38 ++++++++++++++++++++++++++------------ 1 files changed, 26 insertions(+), 12 deletions(-) diff --git a/rc.shutdown b/rc.shutdown index 878e538..db6a122 100755 --- a/rc.shutdown +++ b/rc.shutdown @@ -98,6 +98,17 @@ stat_busy "Deactivating Swap" /sbin/swapoff -a stat_done +stat_busy "Unmounting Loop Filesystems" +/bin/umount -a -r -t noramfs,notmpfs,nosysfs,noproc -O no_netdev,loop +stat_done + +fsckret_loop=0 +if [ "$SHUTDOWN_FSCK" = "yes" -o "$SHUTDOWN_FSCK" = "YES" ]; then + FORCEFSCK= + fsck_loop + fsckret_loop=$fsckret +fi + stat_busy "Unmounting Filesystems" /bin/umount -a -r -t noramfs,notmpfs,nosysfs,noproc -O no_netdev stat_done @@ -106,23 +117,26 @@ stat_busy "Remounting Root Filesystem Read-only" /bin/mount -n -o remount,ro / stat_done +fsckret=0 if [ "$SHUTDOWN_FSCK" = "yes" -o "$SHUTDOWN_FSCK" = "YES" ]; then FORCEFSCK= fsck_all - if [ ${fsckret} -gt 1 -a ${fsckret} -ne 32 ]; then - echo - echo "***************** FILESYSTEM CHECK FAILED ****************" - echo "* *" - echo "* The filesystem will be checked again on next boot. *" - echo "* If the error persists, you'll be given a chance to fix *" - echo "* the problem manually. *" - echo "* *" - echo "************************************************************" - echo - sleep 20 - fi fi +(( fsckret|=fsckret_loop )) +if [ ${fsckret} -gt 1 -a ${fsckret} -ne 32 ]; then + echo + echo "***************** FILESYSTEM CHECK FAILED ****************" + echo "* *" + echo "* The filesystem will be checked again on next boot. *" + echo "* If the error persists, you'll be given a chance to fix *" + echo "* the problem manually. *" + echo "* *" + echo "************************************************************" + echo + sleep 20 +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:" -- 1.7.0.2