Bug 485199 - 'service qdiskd restart' doesn't work
Summary: 'service qdiskd restart' doesn't work
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: cman
Version: 5.3
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Lon Hohberger
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-02-12 10:20 UTC by Juanjo Villaplana
Modified: 2009-09-02 11:09 UTC (History)
5 users (show)

Fixed In Version: cman-2.0.100-1.el5
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-09-02 11:09:33 UTC
Target Upstream Version:
Embargoed:


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


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2009:1341 0 normal SHIPPED_LIVE Low: cman security, bug fix, and enhancement update 2009-09-01 10:43:16 UTC

Description Juanjo Villaplana 2009-02-12 10:20:01 UTC
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 15:52:52 UTC
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 08:46:02 UTC
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 08:50:24 UTC
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 22:01:23 UTC
Yeah, that would do it.

Comment 5 Lon Hohberger 2009-02-26 20:30:40 UTC
Merged to master branch.

Comment 8 Corey Marthaler 2009-03-17 21:02:36 UTC
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 19:11:38 UTC
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 11:09:33 UTC
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.