I just saw the same problem upgrading to sarge. I had a look around and
it looks like the script simply wasn't written to be run under set -e.
When a script uses $? liberally to explicitly test success/failure of
commands, you can't just enable -e and expect it to work. You have
to carefully inspect it to make sure that all failure cases are handled
so that they don't cause the script to bomb out when it shouldn't.
Message-ID: <email address hidden>
Date: Fri, 25 Mar 2005 14:19:23 +1100
From: Herbert Xu <email address hidden>
To: <email address hidden>, <email address hidden>, <email address hidden>,
adconrad@0c3.net
Subject: Re: Bug#300703: autofs: Upgrade fails
--ReaqsoxgOBHFXBhH Disposition: inline
Content-Type: text/plain; charset=us-ascii
Content-
I just saw the same problem upgrading to sarge. I had a look around and
it looks like the script simply wasn't written to be run under set -e.
When a script uses $? liberally to explicitly test success/failure of
commands, you can't just enable -e and expect it to work. You have
to carefully inspect it to make sure that all failure cases are handled
so that they don't cause the script to bomb out when it shouldn't.
I made an attempt to do this here. No guarantees that this catches www.openswan. org/ gondor. apana.org. au/~herbert/ gondor. apana.org. au/~herbert/ pubkey. txt
all the problems but it does let me finish configuring the package.
--
Visit Openswan at http://
Email: Herbert Xu ~{PmV>HI~} <email address hidden>
Home Page: http://
PGP Key: http://
--ReaqsoxgOBHFXBhH Disposition: attachment; filename= "autofs. patch"
Content-Type: text/plain; charset=us-ascii
Content-
--- autofs.old 2005-03-25 14:09:01.000000000 +1100 `LC_ALL= C grep $l /proc/mounts | awk '{print $1}'` /var/run/ autofs/ `echo $mnt | sed 's,/,_,g'`.pid
+++ autofs 2005-03-25 14:18:43.000000000 +1100
@@ -448,11 +448,11 @@
echo ""
echo -n $"Unmounting loopback filesystem $match: "
loopdev=
- umount -d $match
- if [ $? -eq 0 ]; then
+ if umount -d $match; then
echo "done"
else
echo "failed ($?)"
+ exit 1
fi
fi
done
@@ -470,11 +470,11 @@
if [ -n "$match" ]; then
echo ""
echo -n $"Unmounting loopback filesystem $match: "
- umount -d $match
- if [ $? -eq 0 ]; then
+ if umount -d $match; then
echo "done"
else
echo "failed ($?)"
+ exit 1
fi
fi
done
@@ -629,13 +629,12 @@
mnt=`echo $rest | sed 's/^.* \(\/[^ ]*\) [A-Za-z].*$/\1/'`
pidfile=
- start-stop-daemon --start --pidfile $pidfile --quiet \
+ if ! start-stop-daemon --start --pidfile $pidfile --quiet \
--exec $DAEMON -- --pid-file=$pidfile $rest
-
- if [ $? -ne 0 ]
then
echo
echo " failed to start automount point $mnt"
+ exit 1
fi
done
@@ -658,8 +657,8 @@
start- stop-daemon --stop --quiet \ EXIT_WAIT \
--retry USR2/$DAEMON_
- --pidfile $file --exec $DAEMON
- ret=$?
+ --pidfile $file --exec $DAEMON ||
+ ret=$?
case $ret in /var/run/ autofs/ `echo $mnt | sed 's,/,_,g'`.pid
0)
@@ -675,7 +674,7 @@
;;
*)
echo -n -e \
- "\n Strange start-stop-daemon exit status: $?"
+ "\n Strange start-stop-daemon exit status: $ret"
;;
esac
fi
@@ -718,12 +717,12 @@
mnt=`echo $rest | sed 's/^.* \(\/[^ ]*\) [A-Za-z].*$/\1/'`
pidfile=
- start-stop-daemon --start --pidfile $pidfile --quiet \
+ if ! start-stop-daemon --start --pidfile $pidfile --quiet \
--exec $DAEMON -- --pid-file=$pidfile $rest
-
- if [ $? -ne 0 ]; then
+ then
echo
echo " failed to start automount point $mnt"
+ exit 1
else
echo "Started automounter: $mnt"
fi
--ReaqsoxgOBHFX BhH--