Bug 623788 - Init script fails for restart if daemon is running.
Init script fails for restart if daemon is running.
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: autofs (Show other bugs)
13
All Linux
high Severity medium
: ---
: ---
Assigned To: Ian Kent
Fedora Extras Quality Assurance
:
Depends On:
Blocks: 624919
  Show dependency treegraph
 
Reported: 2010-08-12 15:02 EDT by Orion Poplawski
Modified: 2010-09-07 22:20 EDT (History)
4 users (show)

See Also:
Fixed In Version: autofs-5.0.5-28.fc13
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 624919 (view as bug list)
Environment:
Last Closed: 2010-09-07 22:20:48 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 Orion Poplawski 2010-08-12 15:02:55 EDT
Description of problem:

The init script is broken for restarts.  I think this fixes:

diff -u -r1.1 autofs-5.0.5-make-redhat-init-script-more-lsb-compliant.patch
--- autofs-5.0.5-make-redhat-init-script-more-lsb-compliant.patch       24 May
2010 03:01:04 -0000       1.1
+++ autofs-5.0.5-make-redhat-init-script-more-lsb-compliant.patch       19 Jul
2010 17:47:14 -0000
@@ -61,7 +61,7 @@

  function restart() {
 -      stop
-+      status > /dev/null 2>&1
++      status -p /var/run/autofs.pid -l autofs $prog > /dev/null 2>&1
 +      if [ $? -eq 0 ]; then
 +              stop
 +      fi
Comment 1 Michal Jaegermann 2010-08-12 18:38:42 EDT
(In reply to comment #0)

> The init script is broken for restarts.  I think this fixes:

It appears that this should read:

   status -p /var/run/autofs.pid -l $prog

instead of 

   status -p /var/run/autofs.pid -l autofs $prog

but this indeed fixes the problem for me.  autofs-5.0.5-26.fc13 has surely broken startup script as 'status > /dev/null 2>&1' invariably ends as 1.
Comment 2 Orion Poplawski 2010-08-12 18:46:29 EDT
I think my original is correct. -p is pid file, -l is lock file name, and then you pass the program name.
Comment 3 Michal Jaegermann 2010-08-12 19:04:06 EDT
(In reply to comment #2)
> I think my original is correct. -p is pid file, -l is lock file name, and then
> you pass the program name.    

Yes, I think that you are right. OTOH it appears that just
'status -p /var/run/autofs.pid' is good enough and remaining arguments are not that essential.
Comment 4 Ian Kent 2010-08-18 01:01:58 EDT
(In reply to comment #3)
> (In reply to comment #2)
> > I think my original is correct. -p is pid file, -l is lock file name, and then
> > you pass the program name.    
> 
> Yes, I think that you are right. OTOH it appears that just
> 'status -p /var/run/autofs.pid' is good enough and remaining arguments are not
> that essential.

It turns out that changing the status call to "status autofs"
will use the correct pid file.
Comment 5 Ian Kent 2010-08-18 01:02:33 EDT
*** Bug 624694 has been marked as a duplicate of this bug. ***
Comment 6 Fedora Update System 2010-08-18 01:06:03 EDT
autofs-5.0.5-27.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/autofs-5.0.5-27.fc13
Comment 7 Ian Kent 2010-08-18 01:08:41 EDT
(In reply to comment #6)
> autofs-5.0.5-27.fc13 has been submitted as an update for Fedora 13.
> http://admin.fedoraproject.org/updates/autofs-5.0.5-27.fc13

Can you all try this build please.
Comment 8 Michal Jaegermann 2010-08-18 01:26:17 EDT
(In reply to comment #7)
> 
> Can you all try this build please.

Yes, it does work in my tests.  OTOH I noticed only now that while running
'service autofs status' you are going full blast:

case "$1" in
...
        status)
                status -p /var/run/autofs.pid -l autofs $prog
                ;;
...

Does it matter that two ways in two places are used or this is by design?
Comment 9 Ian Kent 2010-08-18 02:34:39 EDT
(In reply to comment #8)
> (In reply to comment #7)
> > 
> > Can you all try this build please.
> 
> Yes, it does work in my tests.  OTOH I noticed only now that while running
> 'service autofs status' you are going full blast:
> 
> case "$1" in
> ...
>         status)
>                 status -p /var/run/autofs.pid -l autofs $prog
>                 ;;
> ...
> 
> Does it matter that two ways in two places are used or this is by design?

From a sensibility point of view it probably does matter.

It turns out that "status autofs" is equivalent to
"status -p /var/run/autofs.pid" as long as the pid file is
located in /var/run.

So it would only be a problem if the location of the pid
file changed which isn't likely. At some point I'll need
to go over the entire init script and fix these little
inconsistencies, but for now I'd rather leave it as it is.
Comment 10 Ian Kent 2010-08-18 02:47:14 EDT
(In reply to comment #9)
> (In reply to comment #8)
> > (In reply to comment #7)
> > > 
> > > Can you all try this build please.
> > 
> > Yes, it does work in my tests.  OTOH I noticed only now that while running
> > 'service autofs status' you are going full blast:
> > 
> > case "$1" in
> > ...
> >         status)
> >                 status -p /var/run/autofs.pid -l autofs $prog
> >                 ;;
> > ...
> > 
> > Does it matter that two ways in two places are used or this is by design?
> 
> From a sensibility point of view it probably does matter.
> 
> It turns out that "status autofs" is equivalent to
> "status -p /var/run/autofs.pid" as long as the pid file is
> located in /var/run.

Similarly the "autofs" parameter also covers the -l.

The reason that the -p and the -l was needed in the first
place was that $prog is not the same as the base name of
the pid and lock files, which is autofs rather than
automount.
Comment 11 Fedora Update System 2010-08-19 21:29:05 EDT
autofs-5.0.5-27.fc13 has been pushed to the Fedora 13 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update autofs'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/autofs-5.0.5-27.fc13
Comment 12 Fedora Update System 2010-08-26 23:30:31 EDT
autofs-5.0.5-28.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/autofs-5.0.5-28.fc13
Comment 13 Fedora Update System 2010-09-07 22:20:35 EDT
autofs-5.0.5-28.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

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