Bug 146036 - init script regex is broken for gulm check
Summary: init script regex is broken for gulm check
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Cluster Suite
Classification: Retired
Component: cman
Version: 4
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Adam "mantis" Manthei
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-01-24 21:00 UTC by Corey Marthaler
Modified: 2009-04-16 19:56 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-02-02 21:17:18 UTC
Embargoed:


Attachments (Terms of Use)

Description Corey Marthaler 2005-01-24 21:00:18 UTC
Description of problem:
init scripts start both a quorate gulm and cman cluster even though
only gulm in in the cluster.conf file.


After boot:
[root@morph-01 root]# gulm_tool getstats morph-01
I_am = Master
quorum_has = 3
quorum_needs = 2
rank = 0
quorate = true
GenerationID = 1106587995420233
run time = 141
pid = 1754
verbosity = Default
failover = enabled
[root@morph-01 root]# cat /proc/cluster/nodes
Node  Votes Exp Sts  Name
   1    1    5   M   morph-01
   2    1    5   M   morph-02
   3    1    5   M   morph-04
   4    1    5   M   morph-05
   5    1    5   M   morph-03


cluster.conf file:
<?xml version="1.0"?>
<cluster name="morph-cluster" config_version="1">

<gulm>
        <lockserver name="morph-01"/>
        <lockserver name="morph-03"/>
        <lockserver name="morph-05"/>
</gulm>

<clusternodes>
        <clusternode name="morph-01.lab.msp.redhat.com" votes="1">

                <fence>
                        <method name="single">
                                <device name="apc" switch="1" port="1"/>
                        </method>
                </fence>
        </clusternode>
        <clusternode name="morph-02.lab.msp.redhat.com" votes="1">

                <fence>
                        <method name="single">
                                <device name="apc" switch="1" port="2"/>
                        </method>
                </fence>
        </clusternode>
        <clusternode name="morph-03.lab.msp.redhat.com" votes="1">

                <fence>
                        <method name="single">
                                <device name="apc" switch="1" port="3"/>
                        </method>
                </fence>
        </clusternode>
        <clusternode name="morph-04.lab.msp.redhat.com" votes="1">

                <fence>
                        <method name="single">
                                <device name="apc" switch="1" port="4"/>
                        </method>
                </fence>
        </clusternode>
        <clusternode name="morph-05.lab.msp.redhat.com" votes="1">

                <fence>
                        <method name="single">
                                <device name="apc" switch="1" port="5"/>
                        </method>
                </fence>
        </clusternode>

</clusternodes>


<fencedevices>
        <fencedevice name="apc" agent="fence_apc" ipaddr="morph-apc"
login="apc" passwd="apc"/>
</fencedevices>


<rm>
</rm>

</cluster>

Version-Release number of selected component (if applicable):
CMAN <CVS> (built Jan 20 2005 14:20:36) installed

How reproducible:
Always

Comment 1 Adam "mantis" Manthei 2005-01-24 22:08:04 UTC
Index: cman/init.d/cman
===================================================================
RCS file: /cvs/cluster/cluster/cman/init.d/cman,v
retrieving revision 1.1.2.4
diff -u -p -r1.1.2.4 cman
--- cman/init.d/cman    20 Jan 2005 22:50:29 -0000      1.1.2.4
+++ cman/init.d/cman    24 Jan 2005 22:03:26 -0000
@@ -36,7 +36,7 @@ start()
        # FIXME -- Should this be silent?  I think users should get some
        #          feedback, but others might not want added verbosity to
        #          the boot process.  Oh well... it's only one line :)
-       if grep -qE "<[\t ]*gulm[\t ].*>" /etc/cluster/cluster.conf
+       if grep -qE "<[[:space:]]*gulm([[:space:]]|[>]|$)"
/etc/cluster/cluster.conf
        then
                echo "<gulm> section detected in
/etc/cluster/cluster.conf"
                return 1
Index: gulm/init.d/lock_gulmd
===================================================================
RCS file: /cvs/cluster/cluster/gulm/init.d/lock_gulmd,v
retrieving revision 1.1.2.6
diff -u -p -r1.1.2.6 lock_gulmd
--- gulm/init.d/lock_gulmd      20 Jan 2005 22:50:28 -0000      1.1.2.6
+++ gulm/init.d/lock_gulmd      24 Jan 2005 22:03:26 -0000
@@ -156,7 +156,7 @@ start()
        #          the boot process.  Oh well... it's only one line :)
        if echo "$GULM_OPTS" | grep -qE "(--use_ccs|[\t ]-[VhCed]*c)" 
        then
-               if ! grep -qE "<[\t ]*gulm[\t ]*.*>"
/etc/cluster/cluster.conf 
+               if ! grep -qE "<[[:space:]]*gulm([[:space:]]|[>]|$)"
/etc/cluster/cluster.conf 
                then
                        echo "no <gulm> section detected in
/etc/cluster/cluster.conf"
                        return 1



Checking in cman/init.d/cman;
/cvs/cluster/cluster/cman/init.d/cman,v  <--  cman
new revision: 1.1.2.5; previous revision: 1.1.2.4
done
Checking in gulm/init.d/lock_gulmd;
/cvs/cluster/cluster/gulm/init.d/lock_gulmd,v  <--  lock_gulmd
new revision: 1.1.2.7; previous revision: 1.1.2.6
done



Comment 2 Corey Marthaler 2005-02-02 21:17:18 UTC
fix verified.


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