Bug 164223 - /etc/init.d/autofs fails to use parameters from /etc/sysconfig/autofs
/etc/init.d/autofs fails to use parameters from /etc/sysconfig/autofs
Status: CLOSED INSUFFICIENT_DATA
Product: Fedora
Classification: Fedora
Component: autofs (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Ian Kent
Brock Organ
bzcl34nup
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-07-25 22:09 EDT by David Johnson
Modified: 2008-05-06 20:13 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-05-06 20:13:10 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch for bad use of "grep \B" in autofs init script (1.61 KB, patch)
2005-07-27 15:52 EDT, David Johnson
no flags Details | Diff

  None (edit)
Description David Johnson 2005-07-25 22:09:24 EDT
Description of problem:

/etc/init.d/autofs fails to use command-line arguments from
/etc/sysconfig/autofs under some situations.

Version-Release number of selected component (if applicable):

4.1.3-47 (and, I think, autofs-4.1.3-130 too)

How reproducible:

Easily


Steps to Reproduce:
1. Change the appropriate line in /etc/sysconfig/autofs to the following

DAEMONOPTIONS="--debug --timeout=30"

2. Reboot the machine

3. Run "ps -wwwaux | fgrep autofs"
  
Actual results:

The "--debug" command-line parameter won't be given to the automount processes.


Expected results:

All automount process should have a "--debug" parameter in the ps output.

Additional info:

From my reading of the grep man page, it seems all regular expressions with a
'\B' in autofs/sample/autofs.rc.in
are wrong - it looks like it's being used as "beginning of word" when I
think it means "not edge of word".  IMPORTANT - using \< and /> also
has issues - whether a leading "-" is considered part of a word is also LANG
dependent.
One possible solution is to add " " to all of the stdin's that are grepped
and break based on whitespace, but I haven't got a full patch yet.

Also note that another sypmtom of this bug is that sometimes "/etc/init.d/autofs
status" and "service autofs status" give different results, which is somewhat
confusing.   I think it's env variable related - SHELL and LANG stuff affect it
- but this should go away if the main issue is fixed.
Comment 1 Jeffrey Moyer 2005-07-27 09:34:48 EDT
This bug should be fixed in 4.1.3-130.  Please retest.  Here is the relevant
changelog entry:

- Different locales impart different meanings in terms of what
  characters are said to be "word" characters and which are not.  The
  intention of the code is that LC_ALL is set to C.  This patch does this
  so that the grep's will work properly.
- This fixes problems whereby --ghost options were not recognized when
  specified in /etc/sysconfig/autofs.
Comment 2 David Johnson 2005-07-27 14:12:40 EDT
This does indeed fix the symptoms.  But it doesn't actually fix the cause.
With the. 4.1.3-130 code, putting e.g. "--not--verbose" in sysconfig will still
set the verbose flag, which is obviously not what the script writer intended.

The code on e.g. line 252 of /etc/init.d/autofs in 4.1.3-130 says (in
pseudo-regexp):

::not_edge_of_word::-(v::edge_of_word::|-verbose::edge_of_word::)

This works becaude the edge of word is between the "-" and the "v", so saying
::not_edge_of_word:: at the beginning doesn't break it, but it's not really
doing what you want.  It seems that if LC_ALL==C then "-" is not part of a word
but the regexp is written as if it should be, but also as if \B means
::beginning_of_word:: (which according to the grep man page it doesn't).

Feel free to call me on 510-666-2983 if my explanation isn't clear.
Comment 3 Jeffrey Moyer 2005-07-27 14:26:31 EDT
Thank you for taking the time to explain this.  However, if this bug does not
rear its ugly head in the wild, it is not going to be considered for an update
release.  Feel free to do either or both of the following:

o Propose a patch upstream (autofs@linux.kernel.org)
o Change the "Product" field of this bug to Fedora, and propose a patch.  The
patch will be gladly accepted.

Thanks.
Comment 4 David Johnson 2005-07-27 15:52:47 EDT
Created attachment 117210 [details]
Patch for bad use of "grep \B" in autofs init script
Comment 5 David Johnson 2005-07-27 15:56:44 EDT
I've attached a patch that worked for me on RHEL3. I've not idea which version of
FC this'll work on, i.e. which includes autofs-4.1.3-130 or similar, so I'll let
you guys switch the product to something more appropriate.
Comment 6 Jeffrey Moyer 2005-07-27 15:58:46 EDT
Thanks!
Comment 7 Ian Kent 2006-06-21 21:32:01 EDT
(In reply to comment #5)
> I've attached a patch that worked for me on RHEL3. I've not idea which version of
> FC this'll work on, i.e. which includes autofs-4.1.3-130 or similar, so I'll let
> you guys switch the product to something more appropriate.

David, autofs no longer does this parsing in the init script.
Can you check the functionality in either FC6 test1 or Rawhide
and let me know if a problem is still present.
Comment 9 Bug Zapper 2008-04-03 12:16:07 EDT
Based on the date this bug was created, it appears to have been reported
against rawhide during the development of a Fedora release that is no
longer maintained. In order to refocus our efforts as a project we are
flagging all of the open bugs for releases which are no longer
maintained. If this bug remains in NEEDINFO thirty (30) days from now,
we will automatically close it.

If you can reproduce this bug in a maintained Fedora version (7, 8, or
rawhide), please change this bug to the respective version and change
the status to ASSIGNED. (If you're unable to change the bug's version
or status, add a comment to the bug and someone will change it for you.)

Thanks for your help, and we apologize again that we haven't handled
these issues to this point.

The process we're following is outlined here:
http://fedoraproject.org/wiki/BugZappers/F9CleanUp

We will be following the process here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping to ensure this
doesn't happen again.
Comment 10 Bug Zapper 2008-05-06 20:13:09 EDT
This bug has been in NEEDINFO for more than 30 days since feedback was
first requested. As a result we are closing it.

If you can reproduce this bug in the future against a maintained Fedora
version please feel free to reopen it against that version.

The process we're following is outlined here:
http://fedoraproject.org/wiki/BugZappers/F9CleanUp

Note You need to log in before you can comment on or make changes to this bug.