SVN: rc-scripts/trunk: rc.d/rc.shutdown sysconfig/system

baggins baggins at pld-linux.org
Mon Mar 16 00:09:35 CET 2009


Author: baggins
Date: Mon Mar 16 00:09:35 2009
New Revision: 10211

Modified:
   rc-scripts/trunk/rc.d/rc.shutdown
   rc-scripts/trunk/sysconfig/system
Log:
- added UMOUNT_IGNORE option


Modified: rc-scripts/trunk/rc.d/rc.shutdown
==============================================================================
--- rc-scripts/trunk/rc.d/rc.shutdown	(original)
+++ rc-scripts/trunk/rc.d/rc.shutdown	Mon Mar 16 00:09:35 2009
@@ -64,9 +64,15 @@
 	sig=-15
 	retry=3
 	force=
-	remaining=$(awk '$3 !~ /^(proc|loopfs|devpts|shm|iso9660|ramfs|tmpfs|sysfs|securityfs|squashfs)$/ \
+	if [ -z "$UMOUNT_IGNORE" ]; then
+		UMOUNT_IGNORE="/"
+	else    
+		UMOUNT_IGNORE="/ $UMOUNT_IGNORE"
+	fi      
+	remaining=$(awk -v ig="^($UMOUNT_IGNORE)$" 'BEGIN { gsub(/[\t ]+/, "|", ig); } \
+			$3 !~ /^(proc|loopfs|devpts|shm|iso9660|ramfs|tmpfs|sysfs|securityfs|squashfs)$/ \
 			&& $1 !~ /^(none|\/dev\/root)$/ \
-			&& $2 !~ /^\/$/ {print $2}' /proc/mounts)
+			&& $2 !~ ig {print $2}' /proc/mounts)
 	while [ -n "$remaining" -a "$retry" -gt 0 ]; do
 	 	show "Unmounting file systems"; busy
 		ERRORS=$(umount -a $force -t noproc 2>&1); rc=$?
@@ -87,9 +93,10 @@
 		fi
 
 		sleep 2
-		remaining=$(awk '$3 !~ /^(proc|loopfs|devpts|shm|iso9660|ramfs|tmpfs|sysfs|securityfs|squashfs)$/ \
+		remaining=$(awk -v ig="^($UMOUNT_IGNORE)$" 'BEGIN { gsub(/[\t ]+/, "|", ig); } \
+				$3 !~ /^(proc|loopfs|devpts|shm|iso9660|ramfs|tmpfs|sysfs|securityfs|squashfs)$/ \
 				&& $1 !~ /^(none|\/dev\/root)$/ \
-				&& $2 !~ /^\/$/ {print $2}' /proc/mounts)
+				&& $2 !~ ig {print $2}' /proc/mounts)
 		[ -z "$remaining" ] && break
 		fuser -k -m $sig $remaining > /dev/null
 		sleep 5

Modified: rc-scripts/trunk/sysconfig/system
==============================================================================
--- rc-scripts/trunk/sysconfig/system	(original)
+++ rc-scripts/trunk/sysconfig/system	Mon Mar 16 00:09:35 2009
@@ -98,6 +98,11 @@
 # chroot properly)
 #SYSTEM_CHROOTS=
 
+# List (space separated) of special mount points that must not be unmounted
+# on system shutdown.
+# May contain regular exporessions (eg. "/dev/rootunion/.*")
+#UMOUNT_IGNORE=
+
 # Enable cpusets support?
 CPUSETS=no
 


More information about the pld-cvs-commit mailing list