The init.d script when asked to reload compares the list of required
mount commands (in TMP1) against the list of currently-running automount
processes (in TMP2).
However, automount fork()s as it runs, so the process list in TMP2
will, potentially, contain these child processes. The result of this is
(conter-intuitively) that thescript tries to start *another* process.
(The reason is that when you grep TMP2 for the mountpoint of the TMP1
entry you get 2 lines, which doesn't match the one line, so the code
thinks it isn't there).
There is a simple fix for this - change the process-finding command
to include the ppid (using Unix, rather than BSD options) and only
select the lines with ppid==1.
ie: replace:
ps axwww|grep "[0-9]:[0-9][0-9] $DAEMON " | (
while read pid tt stat time command; do
with
# Remove duplicates (which happen transiently on fork()ing?)
# Only need the pid, but also match against ppid, so we only get
# "parent" automount processes not forked ones.
# (The [1] in the grep is so that the grep command doesn't match)
#
ps -e -opid=,ppid=,command= | grep " [1] $DAEMON " | (
while read pid ppid command; do
_______________________________________________
autofs mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/autofs