]> git.pld-linux.org Git - projects/rc-scripts.git/commitdiff
- added UMOUNT_IGNORE option
authorJan Rękorajski <baggins@pld-linux.org>
Sun, 15 Mar 2009 23:09:35 +0000 (23:09 +0000)
committerJan Rękorajski <baggins@pld-linux.org>
Sun, 15 Mar 2009 23:09:35 +0000 (23:09 +0000)
svn-id: @10211

rc.d/rc.shutdown
sysconfig/system

index dc578e5cca22f447080a9bd316c59a4f0d25d0a4..7a39fb894752d94669eca417c49440c0bf514f4f 100755 (executable)
@@ -64,9 +64,15 @@ if ! is_yes "$VSERVER"; then
        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 @@ if ! is_yes "$VSERVER"; then
                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
index 617d016b84ca6fa8775fde5f6de8dd5d43d44485..de417858a77582faf0b30245828b234ae10d60ef 100644 (file)
@@ -98,6 +98,11 @@ RC_PROMPT=yes
 # 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
 
This page took 1.177353 seconds and 4 git commands to generate.