Bug 485199 - 'service qdiskd restart' doesn't work
'service qdiskd restart' doesn't work
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: cman (Show other bugs)
5.3
All Linux
low Severity medium
: rc
: ---
Assigned To: Lon Hohberger
Cluster QE
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-02-12 05:20 EST by Juanjo Villaplana
Modified: 2009-09-02 07:09 EDT (History)
5 users (show)

See Also:
Fixed In Version: cman-2.0.100-1.el5
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-09-02 07:09:33 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
Proposed fix (307 bytes, patch)
2009-02-13 03:50 EST, Juanjo Villaplana
no flags Details | Diff

  None (edit)
Description Juanjo Villaplana 2009-02-12 05:20:01 EST
Description of problem:
The qdiskd init script doesn't works as expected. Issuing a "restart" only stops the service, issuing "stop" and "start" works fine.

Version-Release number of selected component (if applicable):
cman-2.0.98-1.el5

How reproducible:
Always

Steps to Reproduce:
1.# service qdiskd restart
  Stopping the Quorum Disk Daemon:                           [  OK  ]
  Starting the Quorum Disk Daemon:                           [  OK  ]

2.# service qdiskd status 
  qdiskd is stopped
  
Actual results:
qdiskq daemon doesn't start.

Expected results:
qdiskq daemon should be started

Additional info:
This behaviour has been introduced in this release due to the "status" check before starting the daemon and to the fact that the init script and the daemon have the same name.
Comment 1 Lon Hohberger 2009-02-12 10:52:52 EST
I see.  The code we added to make cman start qdiskd intelligently (to prevent quorum-waits) broke 'start'.

The way I would fix this is:

* record pid of qdiskd
* kill (-TERM) pid
* wait for pid to exit
Comment 2 Juanjo Villaplana 2009-02-13 03:46:02 EST
Hi Lon,

The buggy code is in the way you check the status from inside "start", not in the way you kill qdiskd:

# cp -p /etc/init.d/qdiskd /etc/init.d/qdisk
# service qdisk restart
Stopping the Quorum Disk Daemon:                           [  OK  ]
Starting the Quorum Disk Daemon:                           [  OK  ]
# service qdisk status
qdiskd (pid 22310) is running...

If the daemon and the init script doesn't share the name it works fine.
Comment 3 Juanjo Villaplana 2009-02-13 03:50:24 EST
Created attachment 331817 [details]
Proposed fix

This patch fixes this bug.

I haven't defined a function for the "status" code, but if you plan to add more code to the "status" clause, may be better to define a function and call it from "status", "start" and whenever is needed.
Comment 4 Lon Hohberger 2009-02-13 17:01:23 EST
Yeah, that would do it.
Comment 5 Lon Hohberger 2009-02-26 15:30:40 EST
Merged to master branch.
Comment 8 Corey Marthaler 2009-03-17 17:02:36 EDT
Fix verified in cman-2.0.99-1.el5.

[root@grant-01 ~]# cman_tool nodes
Node  Sts   Inc   Joined               Name
   0   M      0   2009-03-17 15:56:28  /dev/dm-5
   1   M  26160   2009-03-17 15:55:40  grant-01
   2   M  26168   2009-03-17 15:55:42  grant-02
   3   M  26172   2009-03-17 15:55:43  grant-03

[root@grant-01 ~]# service qdiskd restart
Stopping the Quorum Disk Daemon:                           [  OK  ]
Starting the Quorum Disk Daemon:                           [  OK  ]

[root@grant-01 ~]# cman_tool nodes
Node  Sts   Inc   Joined               Name
   0   M      0   2009-03-17 15:56:28  /dev/dm-5
   1   M  26160   2009-03-17 15:55:40  grant-01
   2   M  26168   2009-03-17 15:55:42  grant-02
   3   M  26172   2009-03-17 15:55:43  grant-03
Comment 10 Lon Hohberger 2009-07-22 15:11:38 EDT
Cause: Running 'service qdiskd restart'

Consequence: Qdiskd is not restarted correctly

Fix: Fix the status check clause preventing correct restart operation

Result: Qdiskd is now restarted correctly.
Comment 12 errata-xmlrpc 2009-09-02 07:09:33 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2009-1341.html

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