Bug#422909: Bourne shell assistance needed for Bug #422909

2007-06-10 Thread Oleg Verych
* From: Roger Leigh * Date: Wed, 09 May 2007 22:48:49 +0100 Hi folks, Hallo. # Unmount all filesystem under specified location # $1: mount base location do_umount_all() { $LIBEXEC_DIR/schroot-listmounts -m $1 | while read mountloc; do if [ $AUTH_VERBOSITY = verbose ]; then

Bug#422909: Bourne shell assistance needed for Bug #422909

2007-05-10 Thread Adeodato Simó
* Junichi Uekawa [Thu, 10 May 2007 09:00:27 +0900]: I think you are looking for set -o pipefail in bash. Note this is bash-specific. If the script is set -e, Frans' solution is the most straightforward way. Cheers, -- Adeodato Simó dato at

Bug#422909: Bourne shell assistance needed for Bug #422909

2007-05-09 Thread Roger Leigh
Hi folks, Bug #422909 has resulted from a broken assumption in how the shell would handle errors, and I'm unsure exactly how to do this correctly. Any assistance would be greatly appreciated. Given that this can in some circumstances result in severe dataloss, I'd very much like to get this

Bug#422909: Bourne shell assistance needed for Bug #422909

2007-05-09 Thread Stephen Gran
This one time, at band camp, Roger Leigh said: How can I rewrite the while loop securely (and preferably avoiding tmpfiles), such that any bad exit status or failure will result in immediate termination of the script with an error status? Wrap your calls of do_umount_all in if blocks: if

Bug#422909: Bourne shell assistance needed for Bug #422909

2007-05-09 Thread Junichi Uekawa
Hi, The problem here is that if schroot-listmounts segfaults (the trigger in this case) or returns an error, the script continues without any indication of the fact, despite set -e being in effect. In this bug this results in a failure to umount a set of mounted filesystems, and then an rm