Bug 199193 - status and stop functions of init script broken
status and stop functions of init script broken
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: autofs (Show other bugs)
6
All Linux
medium Severity medium
: ---
: ---
Assigned To: Ian Kent
Brock Organ
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-07-17 16:58 EDT by Jeff Bastian
Modified: 2007-11-30 17:11 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-10-05 14:47:55 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)

  None (edit)
Description Jeff Bastian 2006-07-17 16:58:17 EDT
Description of problem:
'service autofs status' reports that the automounter is stopped when it's
running, and 'service autofs stop' fails to stop the automounter even if nothing
is mounted (i.e., it's not getting stuck trying to unmount an active mount). 
See attached transcript.

Version-Release number of selected component (if applicable):
autofs-5.0.1-0.rc1.1
kernel-2.6.17-1.2405.fc6

How reproducible:
Every time

Steps to Reproduce:
1. service autofs start
2. service autofs status
3. service autofs stop

Actual results:
'status' reports the automounter is stopped (even though it's not) and 'stop'
cannot stop the automounter (even though nothing is mounted and preventing it
from stopping cleanly)

Expected results:
'status' should report the automounter is running and 'stop' should stop the service

Additional info:
My system is an LDAP client and it's passing '-DOSREL=rhel_4.0' as a command
line arg to the automount daemon.
Comment 2 Ian Kent 2006-07-17 22:57:08 EDT
(In reply to comment #0)
> Description of problem:
> 'service autofs status' reports that the automounter is stopped when it's
> running, and 'service autofs stop' fails to stop the automounter even if nothing
> is mounted (i.e., it's not getting stuck trying to unmount an active mount). 

Could I have a debug log of the process of start and stop
activity please.

Ian
Comment 6 Ian Kent 2006-07-18 10:47:26 EDT
I'll try and duplicate this on my FC6test1 instance and see
what happens.

The autofs debug log you posted, was the service stop run
while it was logging? It looks like nothing ever got to
autofs.

Ian
Comment 7 Jeff Bastian 2006-07-18 10:59:18 EDT
Yes, I sent the debug log for the time (+30 secs) that I ran the three commands
mentioned earlier.  I noticed the debug log didn't show any activity either when
I tried to stop it.

I'm guessing the init script is having a problem finding the PID of the
automount daemon and thus 'status' reports the daemon is stopped and 'stop'
can't actually stop a daemon it can't find.  This is just a gut feeling, though,
and I haven't spent much time debugging it yet.

Jeff
Comment 8 Jeff Bastian 2006-07-18 11:16:23 EDT
I just added
  set -x
to the beginning of the init script to see what it was running to find the PID
of the automount daemon.  It ran
  pidof -c -o 20780 -o 20777 -o %PPID -x automount
and didn't get anything back.  Out of curiosity, I ran it by hand and removed
the -c flag and it found the PID of the automount daemon.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[root@millipede init.d]# pgrep automount
20747
[root@millipede init.d]# pidof -c -o 20780 -o 20777 -o %PPID -x automount

[root@millipede init.d]# pidof automount
20747
[root@millipede init.d]# pidof -o 20780 -o 20777 -o %PPID -x automount
20747
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I then edited the /etc/rc.d/init.d/functions file and removed the '-c' option
from the __pids_pidof() function and now 'service autofs status' and 'service
autofs stop' work.

I guess this is a bug with the initscripts package, not autofs.  I looked at the
/etc/rc.d/init.d/functions file on my RHEL4 U3 system and the pidof command does
not use the '-c' option.

Jeff
Comment 9 Ian Kent 2006-07-18 11:41:57 EDT
(In reply to comment #8)
> I then edited the /etc/rc.d/init.d/functions file and removed the '-c' option
> from the __pids_pidof() function and now 'service autofs status' and 'service
> autofs stop' work.
> 
> I guess this is a bug with the initscripts package, not autofs.  I looked at the
> /etc/rc.d/init.d/functions file on my RHEL4 U3 system and the pidof command does
> not use the '-c' option.

Cool that will save me a bunch of time.
I'll have a play around with it and add the initscripts maintainer
to the copy list when I post my findings and see if we can get
some attention.

Ian
Comment 14 Jeff Bastian 2006-10-05 14:44:59 EDT
I update my FC6 box again this morning and re-checked this.  It's now at
   autofs-5.0.1-0.rc2.8
   initscripts-8.43-1
and the /etc/rc.d/init.d/functions file still uses the -c option with pidof,
however, everything seems to be working now, so whatever was causing the
problems with earlier FC6 test releases seems to be fixed.  You can probably
close this BZ.

Thanks!
Jeff

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