Bug 199193 - status and stop functions of init script broken
Summary: status and stop functions of init script broken
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: autofs
Version: 6
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Ian Kent
QA Contact: Brock Organ
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-07-17 20:58 UTC by Jeff Bastian
Modified: 2007-11-30 22:11 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-10-05 18:47:55 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Jeff Bastian 2006-07-17 20:58:17 UTC
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-18 02:57:08 UTC
(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 14:47:26 UTC
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 14:59:18 UTC
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 15:16:23 UTC
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 15:41:57 UTC
(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 18:44:59 UTC
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.