Bug 520915 - cmirror init script should use killproc
Summary: cmirror init script should use killproc
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: cmirror
Version: 5.4
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Jonathan Earl Brassow
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-09-02 20:21 UTC by Nate Straz
Modified: 2010-03-30 09:05 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-03-30 09:05:20 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2010:0307 0 normal SHIPPED_LIVE cmirror bug fix update 2010-03-29 14:35:04 UTC

Description Nate Straz 2009-09-02 20:21:55 UTC
Description of problem:

Sometimes during cluster_cleanup, shutting down cmirror fails, stopping our regression tests in their tracks.  The failing call to `service cmirror stop` looks like this when run through sh -x:

+ echo -n 'Stopping clustered mirror log server:'
Stopping clustered mirror log server:+ killall clogd
+ ps -C clogd
+ failure shutdown
+ local rc=0

The init script looks like so:

stop()
{
        echo -n "Stopping clustered mirror log server:"
        killall clogd >& /dev/null
        if ps -C clogd >& /dev/null; then
            failure "shutdown"
            echo
            return 1
        else
            success "shutdown"
        fi
...

If clogd doesn't exit immediately after the signal handler returns, ps could still find clogd running, even though a few moments later it will exit.  This should probably be replaced by a call to killproc which waits for the daemon to exit.


Version-Release number of selected component (if applicable):
cmirror-1.1.39-2.el5

How reproducible:
10% of the time, more frequently on ppc and ia64 or smp systems

Steps to Reproduce:
1. /etc/init.d/cmirror stop
2.
3.
  
Actual results:
See above

Expected results:
cmirror initscript should wait for clogd to exit before continuing.

Additional info:

Comment 1 Jaroslav Kortus 2009-10-14 10:13:27 UTC
Also check the lines regarding the kernel module removal. I can see this failing during our tests quite frequently because the module is not loaded. It should be checked if the module is loaded and then try to remove it.

This also makes it possible to call the script twice with stop parameter and not fail.

Comment 2 Jonathan Earl Brassow 2009-10-14 15:17:06 UTC
Ok, I'll try to fix these.

However, reading the killproc man page, I'm not sure that it is appropriate.  clogd will refuse to honor SIGTERM if there are still active cluster mirrors.  Failing the SIGTERM, killproc will issue a SIGKILL - which we do not want...  So, we want to wait for the SIGTERM to take effect, but not to issue the subsequent SIGKILL... rather, it should fail in that event.

Comment 3 Jonathan Earl Brassow 2009-12-03 21:50:34 UTC
commit 6a5f12eea4e117b3ed50016e737fc4847ccbd634
Author: Jonathan Brassow <jbrassow>
Date:   Thu Dec 3 15:48:04 2009 -0600

    cmirror: Fix-up init script behaviour (bug 520915)

    init script was throwing errors on 'stop' when it
    shouldn't have been.

Comment 6 Nate Straz 2010-03-02 20:22:47 UTC
I have not run into this during recent RHEL 5.5 regression runs.

Comment 8 errata-xmlrpc 2010-03-30 09:05:20 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/RHBA-2010-0307.html


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