Red Hat Bugzilla – Bug 146754
Logical error in if-statements in /etc/init.d/autofs. Options ignored.
Last modified: 2007-11-30 17:10:59 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5)
Description of problem:
I discovered that the option --ghost is being ignored by
/etc/init.d/autofs on Fedora Core 3.
When I examined what happend in /etc/init.d/autofs I found what I
guess is a logical error that probably affects the following options:
ghost, verbose and debug.
In /etc/init.d/autofs we find the following if-statement:
# Check for the ghost option
if echo "$DAEMONOPTIONS $options" | grep -qE --
This if-statement will on Fedore Core 3 not find the options -g or
--ghost, and therefore will never add the option --ghost to
$startupoptions, which causes the options to be ignored.
This bug can be reproduced by others by adding the --ghost option in
the file /etc/sysconfig/autofs, and check the automounting of nis-maps
with the command:
ps -ef | grep auto
You will notice that --ghost is not being used in the startup-command
for the automounters.
The bug itself is that the grep command can not find --ghost on Fedora
core 3 . As a proof run the following command:
[tord@itse6843]~% if echo "--ghost --timeout=60" | grep -qE --
'\B-(g\b|-ghost\b)' ;then echo "Found --ghost"; fi
A collegue of mine suggested to replace the grep-command with grep -w
-qE -- '(-g|--ghost)' ,which seems to work fine.
[tord@itse6843]~% if echo "--ghost --timeout=60" | grep -w -qE --
'(-g|--ghost)' ;then echo "Found --ghost"; fi
The same grep-command is also used to test for the verbose and debug
options, and should probably be replaced too.
When I replaced the grep-command the --ghost option worked fine :) A
new package from Fedora with this change would greatly improve the
user friendlyness on my users many workstations.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Set up a NIS-map which the workstations are supposed to automount
2. On a workstation, in the file /etc/sysconfig/autofs insert --ghost
into the variable DAEMONOPTIONS like this: DAEMONOPTIONS="--ghost
3. Reboot the workstation
4. Run the command: ps -ef | grep auto
Actual Results: You will find that the automount process for the map
does not contain --ghost. You wil see something like:
/usr/sbin/automount --timeout=60 /home yp auto.home
Expected Results: The automount process should contain --ghost like
this: /usr/sbin/automount --timeout=60 --ghost /home yp auto.home
It seems like /etc/init.d/autofs is written to do different thing
depending on if the system it is running on is "Redhat-ish" og Debian.
Maybe the grep-command is ok on Debian, even though it does not work
on Fedora Core 3.
Created attachment 110497 [details]
Patch to explicitly set LC_ALL to C so grep statements will work.
Try this patch. It should fix your problem.
Let me know if this addresses your issues.
Yes, it did. To add
to the start of the getmounts function in /etc/init.d/autofs
did solve the problem.
Thanks for the very fast and great support. I am impressed.
By the way, do you think there will soon come a new version of the rpm, so that
all my clients will get an automatick update by running yum, or should I just
start to patch the clients myself?
I am will probably tomorrow send in a suggestion to the automount-mini-howto
about the ghost option, as I think the information would be usefull to others.
It would be nice if an updated FC3 had a fix.
Yes, this will make it into FC 3 this week.
*** This bug has been marked as a duplicate of 143206 ***