]> git.pld-linux.org Git - projects/rc-scripts.git/commitdiff
Umount remaining filesystems one by one (using -R) option which helps in cases when... master
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Sun, 14 Apr 2024 14:00:06 +0000 (16:00 +0200)
committerArkadiusz Miśkiewicz <arekm@maven.pl>
Sun, 14 Apr 2024 14:00:06 +0000 (16:00 +0200)
rc.d/rc.shutdown

index a3807dd79595195fb1053782b646b58892fa3a62..be5c7857a7152cf42ffca8d386d3e0d2327d8619 100755 (executable)
@@ -81,8 +81,20 @@ if ! is_yes "$VSERVER"; then
                        && $1 !~ /^(none|\/dev\/root)$/ \
                        && $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,nosysfs 2>&1); rc=$?
+               for mnt in $remaining; do
+                       run_cmd "$(nls 'Umounting file system: %s' $mnt)" umount $force -R $mnt
+
+                       # we might had unmounted /usr, recheck $TPUT availability
+                       # but well. we need tput only for show() and busy() (ok() and fail() messages are already cached)
+                       # TODO: look ahead the messages?
+                       if is_yes "$TPUT"; then
+                           TPUT=
+                           rc_gettext_init
+                       fi
+               done
+
+               show "Unmounting remainging file systems"; busy
+               ERRORS=$(umount -a $force -t noproc,nosysfs,notmpfs,nodevpts,nodevtmpfs 2>&1); rc=$?
 
                # we might had unmounted /usr, recheck $TPUT availability
                # but well. we need tput only for show() and busy() (ok() and fail() messages are already cached)
@@ -96,7 +108,10 @@ if ! is_yes "$VSERVER"; then
                        ok
                else
                        fail
-                       [ -n "$ERRORS" ] && echo "$ERRORS"
+                       if [ -n "$ERRORS" ]; then
+                              nls "Umount errors:"
+                              echo "$ERRORS"
+                       fi
                fi
 
                sleep 2
This page took 0.356218 seconds and 4 git commands to generate.