From: Milan Broz <mbroz@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH] fix some issues in clvmd initscript
Date: Wed, 26 May 2010 15:01:06 +0200 [thread overview]
Message-ID: <4BFD1B92.9080403@redhat.com> (raw)
- if daemon is already running, do nothing (and not reactivate VGs)
- always explicitly return exit code in reload()
- fix restart() so it really tries full start & stop and returns exit code
if clvmd -S fails and also touch lockfile afterwards
--- clvmd.old 2010-05-26 14:21:15.000000000 +0200
+++ clvmd 2010-05-26 14:55:17.671245376 +0200
@@ -63,11 +63,12 @@ rh_status_q() {
start()
{
- if ! rh_status_q; then
- echo -n "Starting $DAEMON: "
- daemon $DAEMON $CLVMDOPTS || return $?
- echo
- fi
+
+ rh_status_q && return 0
+
+ echo -n "Starting $DAEMON: "
+ daemon $DAEMON $CLVMDOPTS || return $?
+ echo
# Refresh local cache.
#
@@ -141,7 +142,8 @@ stop()
reload() {
rh_status_q || exit 7
- action "Reloading $DAEMON configuration: " $DAEMON -R || return $?
+ action "Reloading $DAEMON configuration: " $DAEMON -R
+ return $?
}
restart() {
@@ -152,13 +154,15 @@ restart() {
# Try to get clvmd to restart itself. This will preserve
# exclusive LV locks
- action "Restarting $DAEMON: " $DAEMON -S || return $?
+ action "Restarting $DAEMON: " $DAEMON -S
# If that fails then do a normal stop & restart
if [ $? != 0 ]; then
stop && start
+ return $?
else
touch $LOCK_FILE
+ return 0
fi
}
next reply other threads:[~2010-05-26 13:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-26 13:01 Milan Broz [this message]
2010-06-03 7:05 ` [PATCH] fix some issues in clvmd initscript Fabio M. Di Nitto
2010-06-03 9:51 ` Milan Broz
2010-06-03 11:43 ` Fabio M. Di Nitto
2010-06-03 18:31 ` brem belguebli
2010-06-03 19:51 ` Alasdair G Kergon
2010-06-03 20:15 ` Brem Belguebli
2010-06-03 20:20 ` Alasdair G Kergon
2010-06-03 20:25 ` Brem Belguebli
2010-06-03 20:34 ` Alasdair G Kergon
2010-06-03 20:57 ` Brem Belguebli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4BFD1B92.9080403@redhat.com \
--to=mbroz@redhat.com \
--cc=lvm-devel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.