summaryrefslogtreecommitdiffstats
path: root/scripts/clvmd_init_red_hat.in
diff options
context:
space:
mode:
authorChristine Caulfield <ccaulfie@redhat.com>2010-04-20 14:07:37 +0000
committerChristine Caulfield <ccaulfie@redhat.com>2010-04-20 14:07:37 +0000
commitc407d2bd11c6a8e364cfd6a5190bea7d7456db93 (patch)
tree0c913357163f6df3e9aff1f161f2c71848c49cc6 /scripts/clvmd_init_red_hat.in
parent49ada7a2c3f664aa2c3e17e2adf4abaf2a04d17d (diff)
downloadlvm2-c407d2bd11c6a8e364cfd6a5190bea7d7456db93.tar.gz
lvm2-c407d2bd11c6a8e364cfd6a5190bea7d7456db93.tar.xz
lvm2-c407d2bd11c6a8e364cfd6a5190bea7d7456db93.zip
Add -S command to clvmd, so it can restart itself and still
preserve exlusive LV locks.
Diffstat (limited to 'scripts/clvmd_init_red_hat.in')
-rw-r--r--scripts/clvmd_init_red_hat.in12
1 files changed, 11 insertions, 1 deletions
diff --git a/scripts/clvmd_init_red_hat.in b/scripts/clvmd_init_red_hat.in
index ca3a9e41..2a4c1878 100644
--- a/scripts/clvmd_init_red_hat.in
+++ b/scripts/clvmd_init_red_hat.in
@@ -146,7 +146,17 @@ restart() {
# another start. Even if start is protected by rh_status_q,
# that would avoid spawning another daemon, it would try to
# reactivate the VGs.
- stop && start
+
+ # Try to get clvmd to restart itself. This will preserve
+ # exclusive LV locks
+ action "Restarting $DAEMON: " $DAEMON -S || return $?
+
+ # If that fails then do a normal stop & restart
+ if [ $? != 0 ]; then
+ stop && start
+ else
+ touch $LOCK_FILE
+ fi
}
# See how we were called.