Bug 232436

Summary: The clvmd daemon may be deactivated with open vgs
Product: Red Hat Enterprise Linux 5 Reporter: Robert Peterson <rpeterso>
Component: lvm2-clusterAssignee: Milan Broz <mbroz>
Status: CLOSED ERRATA QA Contact: Cluster QE <mspqa-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.0CC: agk, ccaulfie, dwysocha, jbrassow, mbroz, prockai, pvrabec
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2007-0518 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-11-07 19:10:13 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Proposed fix none

Description Robert Peterson 2007-03-15 15:20:30 UTC
Description of problem:
You can shut down the clvmd daemon with active volume groups.
The clvmd init script does a vgchange -aln for each clustered vg.
If the vgchange is unsuccessful, it returns $? as 0, but if it's
successful, it returns 1.  Later in the script, it checks the
return code, but it checks the wrong value.  So either vgchange
is returning the opposite return code, or else the init script
should be changed to check it correctly.

Version-Release number of selected component (if applicable):
RHEL5

How reproducible:
Very

Steps to Reproduce:

[root@trin-10 ~]# service clvmd start
Starting clvmd:                                            [  OK  ]
Activating VGs:   1 logical volume(s) in volume group "bob_vg" now active
  1 logical volume(s) in volume group "trin_vg" now active
  2 logical volume(s) in volume group "VolGroup00" now active
                                                           [  OK  ]
[root@trin-10 ~]# mount -tgfs /dev/bob_vg/lvol0 /mnt/gfs1
[root@trin-10 ~]# service clvmd stop
Deactivating VG bob_vg:   Can't deactivate volume group "bob_vg" with 1 open
logical volume(s)
                                                           [FAILED]
Deactivating VG trin_vg:   0 logical volume(s) in volume group "trin_vg" now active
                                                           [  OK  ]
Stopping clvm:                                             [  OK  ]
  
Actual results:
The clvmd daemon is stopped with bob_vg still active.

Expected results:
The clvmd daemon should not be stopped with active volume groups.

Additional info:
The following patch fixes the init script so that it works.
It also fixes an annoying typo:

[root@trin-10 /etc/init.d]# diff clvmd.orig clvmd
86c86
<               [ $rtrn -ne 0 ] && break
---
>               [ $rtrn -eq 0 ] && break
88c88
<               echo -n "Stopping clvm:"
---
>               echo -n "Stopping clvmd:"

The script would work just fine if vgchange returned a non-zero
return code on (active vg) errors and zero on (inactive vg) successes.

Comment 1 Milan Broz 2007-03-15 16:41:26 UTC
Created attachment 150139 [details]
Proposed fix

Seems that rtrn=$? is incorrectly used, attaching patch with another fix...

Comment 2 Robert Peterson 2007-03-16 14:40:47 UTC
Your attached patch works well.  It's elegant too.
(Mine had a problem).


Comment 3 Milan Broz 2007-03-16 17:30:08 UTC
Fixed upstream in lvm2 2.02.24, will be includen in next rebuild.
Setting state to POST to indicate this.

Comment 4 Kiersten (Kerri) Anderson 2007-04-23 17:31:25 UTC
Fixing Product Name.  Cluster Suite components were integrated into the
Enterprise Linux version 5.0.

Comment 8 errata-xmlrpc 2007-11-07 19:10:13 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 the 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-2007-0518.html