Bug 232436 - The clvmd daemon may be deactivated with open vgs
Summary: The clvmd daemon may be deactivated with open vgs
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: lvm2-cluster
Version: 5.0
Hardware: All
OS: Linux
Target Milestone: ---
: ---
Assignee: Milan Broz
QA Contact: Cluster QE
Depends On:
TreeView+ depends on / blocked
Reported: 2007-03-15 15:20 UTC by Robert Peterson
Modified: 2013-03-01 04:05 UTC (History)
7 users (show)

Fixed In Version: RHBA-2007-0518
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2007-11-07 19:10:13 UTC
Target Upstream Version:

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

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2007:0518 0 normal SHIPPED_LIVE lvm2-cluster bug fix update 2007-10-30 19:04:16 UTC

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):

How reproducible:

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)
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
<               [ $rtrn -ne 0 ] && break
>               [ $rtrn -eq 0 ] && break
<               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.


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