Bug 232436 - The clvmd daemon may be deactivated with open vgs
The clvmd daemon may be deactivated with open vgs
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: lvm2-cluster (Show other bugs)
5.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Milan Broz
Cluster QE
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-03-15 11:20 EDT by Robert Peterson
Modified: 2013-02-28 23:05 EST (History)
7 users (show)

See Also:
Fixed In Version: RHBA-2007-0518
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-11-07 14:10:13 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Proposed fix (1.10 KB, patch)
2007-03-15 12:41 EDT, Milan Broz
no flags Details | Diff

  None (edit)
Description Robert Peterson 2007-03-15 11:20:30 EDT
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 12:41:26 EDT
Created attachment 150139 [details]
Proposed fix

Seems that rtrn=$? is incorrectly used, attaching patch with another fix...
Comment 2 Robert Peterson 2007-03-16 10:40:47 EDT
Your attached patch works well.  It's elegant too.
(Mine had a problem).
Comment 3 Milan Broz 2007-03-16 13:30:08 EDT
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 13:31:25 EDT
Fixing Product Name.  Cluster Suite components were integrated into the
Enterprise Linux version 5.0.
Comment 8 errata-xmlrpc 2007-11-07 14:10:13 EST
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

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