W dniu 29.06.2009 19:02, Petter Reinholdtsen pisze:
[...]
I agree, but when I looked at the patch just now, it do not seem to
work properly.  The exit code ($?) will be that of the last umount
command, while it should report an error if any of the umount calls
failed.

Minor nitpick is that it should use $( ... ) instead of ` ... `, to
use the same notation as the other scripts.

Anyone got a tested patch that report errors correctly?
[...]

Well, I didn't test it, but it should work. I used the same approach with the previous version of initscripts. I'm all ear to comments or improvements.

Piotr
--- umountfs.orig       2009-06-29 20:15:53.628364338 +0200
+++ umountfs.new        2009-06-29 20:09:44.734362975 +0200
@@ -21,7 +21,7 @@
 
        REG_MTPTS=""
        TMPFS_MTPTS=""
-       while read DEV MTPT FSTYPE REST
+       while read -r DEV MTPT FSTYPE REST
        do
                case "$MTPT" in
                  
/|/proc|/dev|/.dev|/dev/pts|/dev/shm|/dev/.static/dev|/proc/*|/sys|/lib/init/rw)
@@ -38,6 +38,7 @@
                        fi
                        ;;
                esac
+               MTPT="\"$(/bin/echo -e "$MTPT")\""
                case "$FSTYPE" in 
                  proc|procfs|linprocfs|devfs|sysfs|usbfs|usbdevfs|devpts)
                        continue
@@ -63,11 +64,11 @@
                if [ "$VERBOSE" = no ]
                then
                        log_action_begin_msg "Unmounting temporary filesystems"
-                       umount $TMPFS_MTPTS
+                       eval umount $TMPFS_MTPTS
                        log_action_end_msg $?
                else
                        log_daemon_msg "Will now unmount temporary filesystems"
-                       umount -v $TMPFS_MTPTS
+                       eval umount -v $TMPFS_MTPTS
                        log_end_msg $?
                fi
        fi
@@ -94,11 +95,11 @@
                if [ "$VERBOSE" = no ]
                then
                        log_action_begin_msg "Unmounting local filesystems"
-                       umount -f -r -d $REG_MTPTS
+                       eval umount -f -r -d $REG_MTPTS
                        log_action_end_msg $?
                else
                        log_daemon_msg "Will now unmount local filesystems"
-                       umount -f -v -r -d $REG_MTPTS
+                       eval umount -f -v -r -d $REG_MTPTS
                        log_end_msg $?
                fi
        fi

Reply via email to