X-Git-Url: https://git.tld-linux.org/?a=blobdiff_plain;f=rc.d%2Frc.shutdown;h=efcaecb61e5d0c51e3927458b0364c512103bdb7;hb=HEAD;hp=02246c314a99fc7ec282fd22bab61ca846e8ad12;hpb=9688f03ab823fc09f097de03b48bcbd46b7db6ff;p=rc-scripts.git diff --git a/rc.d/rc.shutdown b/rc.d/rc.shutdown index 02246c3..efcaecb 100755 --- a/rc.d/rc.shutdown +++ b/rc.d/rc.shutdown @@ -76,12 +76,24 @@ else UMOUNT_IGNORE="/ $UMOUNT_IGNORE" fi remaining=$(awk -v ig="^($UMOUNT_IGNORE)$" 'BEGIN { gsub(/[\t ]+/, "|", ig); } \ - $3 !~ /^(proc|loopfs|devpts|devtmpfs|shm|iso9660|ramfs|tmpfs|sysfs|securityfs|squashfs)$/ \ + $3 !~ /^(proc|loopfs|devpts|devtmpfs|shm|iso9660|ramfs|tmpfs|cgroup|cgroup2|sysfs|securityfs|efivarfs|squashfs)$/ \ && $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) @@ -95,12 +107,15 @@ while [ -n "$remaining" -a "$retry" -gt 0 ]; do ok else fail - [ -n "$ERRORS" ] && echo "$ERRORS" + if [ -n "$ERRORS" ]; then + nls "Umount errors:" + echo "$ERRORS" + fi fi sleep 2 remaining=$(awk -v ig="^($UMOUNT_IGNORE)$" 'BEGIN { gsub(/[\t ]+/, "|", ig); } \ - $3 !~ /^(proc|loopfs|devpts|devtmpfs|shm|iso9660|ramfs|tmpfs|sysfs|securityfs|squashfs)$/ \ + $3 !~ /^(proc|loopfs|devpts|devtmpfs|shm|iso9660|ramfs|tmpfs|cgroup|cgroup2|sysfs|securityfs|efivarfs|squashfs)$/ \ && $1 !~ /^(none|\/dev\/root)$/ \ && $2 !~ ig {print $2}' /proc/mounts) [ -z "$remaining" ] && break