cluster: STABLE32 - rgmanager: fix cpglockd vs rgmanager startup race condition with systemd

Ryan McCabe rmccabe at fedoraproject.org
Tue May 1 13:43:46 UTC 2012


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=16ae7b906511976910aa17f879c9e2a6e14b0cfa
Commit:        16ae7b906511976910aa17f879c9e2a6e14b0cfa
Parent:        44a2a2f0b39b90154d36eeaeac8debeb291c9097
Author:        Fabio M. Di Nitto <fdinitto at redhat.com>
AuthorDate:    Wed Apr 25 09:25:07 2012 +0200
Committer:     Fabio M. Di Nitto <fdinitto at redhat.com>
CommitterDate: Wed Apr 25 09:25:07 2012 +0200

rgmanager: fix cpglockd vs rgmanager startup race condition with systemd

systemd consider a service fully operation as soon as /var/run/foo.pid is
written.

this creates a small window in which rgmanager can start before cpglockd
is operational and rgmanager would fail.

loop over cpglockdump to verify that cpglockd is functional and then
start rgmanager

Signed-off-by: Fabio M. Di Nitto <fdinitto at redhat.com>
---
 rgmanager/init.d/rgmanager.in |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/rgmanager/init.d/rgmanager.in b/rgmanager/init.d/rgmanager.in
index e7ee916..40347ef 100644
--- a/rgmanager/init.d/rgmanager.in
+++ b/rgmanager/init.d/rgmanager.in
@@ -79,6 +79,7 @@ start_cpglockd()
 {
 	rings="$(corosync-objctl 2>/dev/null |grep ringnumber | wc -l)"
 	[ "$rings" -gt "1" ] && service cpglockd start
+	while ! cpglockdump > /dev/null 2>&1; do sleep 1; done
 }
 
 rtrn=0


More information about the cluster-commits mailing list