Package: autofs
Version: 4.1.3+4.1.4beta2-3
Severity: normal

If restarting autofs when a mountpoint is busy, or if the daemon has
been killed manually, then the script never gets around to doing
anything, failing midsentence, without printing an proper error
message, because the start-stop-daemon isn't protected, despite the
error code being explicitly checked thereafter:

30600,43>  /etc/init.d/autofs restart
Stopping automounter:1-0-23:03:30, Sun Mar 13 [EMAIL PROTECTED]:/home/tconnors 
(bash)

Since it makes sense to run restart when the daemon could possibly be
not there (since restart is the automatic thing to do upon an
upgrade), and since it makes sense to restart the daemon when a
mountpoint is busy (new processes will get the new mountpoint with new
mount flags, old processes will continue to use the stale mount
point), then I think the proper thing to do is to print the message,
and then just continue as before.

Is `set -e' really the right thing to do?  I think a wise man
(possibly Dijkstra) once said "don't check for errors you don't
explicitly know how to handle".  Since we already check for all
conceivable errors, then does an extra `set -e' help anything?  It
only seems to cause us to not issue correct errors when we really do
fail -- see also bug 295480.

Relevant trace follows:

30599,42> bash -x /etc/init.d/autofs restart
+ FLAGS='defaults 21'
+ DAEMON=/usr/sbin/automount
...
+ debian restart
+ set -e
+ case "$1" in
+ debian stop
+ set -e
+ case "$1" in
+ echo -n 'Stopping automounter:'
Stopping automounter:+ umount_loopback
++ LC_ALL=C
++ awk '!/^#/ && $1 ~ /^\/dev\/loop/ && $2 != "/" {print $2}' /proc/mounts
+ loops=
++ LC_ALL=C
++ awk '!/^#/ && $1 ~ /^automount/ {print $2}' /proc/mounts
+ automounts=/var/autofs/net
++ LC_ALL=C
++ awk '!/^#/ && $1 ~ /^\/dev\/loop/ && $2 != "/" {print $1}' /proc/mounts
+ loopmnts=
+ any=0
++ ls /var/run/autofs/_var_autofs_net.pid
+ for file in '`ls /var/run/autofs/*.pid 2>/dev/null`'
+ '[' -e /var/run/autofs/_var_autofs_net.pid ']'
+ any=1
++ head -n 1 /var/run/autofs/_var_autofs_net.pid
+ pid=31598
++ ps -wwo cmd= 31598
++ sed -e 's,.* --pid-file=/var/run/autofs/\([^ ]*\)\.pid.*,\1,; s,_,/,g'
+ mnt=
+ start-stop-daemon --stop --quiet --retry USR2/20 --pidfile 
/var/run/autofs/_var_autofs_net.pid --exec /usr/sbin/automount
1-0-23:01:24, Sun Mar 13 [EMAIL PROTECTED]:/home/tconnors (bash)


-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: i386 (i586)
Kernel: Linux 2.4.26
Locale: LANG=en_AU, LC_CTYPE=en_AU (charmap=ISO-8859-1)

Versions of packages autofs depends on:
ii  debconf                     1.4.46       Debian configuration management sy
ii  libc6                       2.3.2.ds1-20 GNU C Library: Shared libraries an

-- debconf information:
* autofs/upgrade-from-broken-version:


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to