Gitweb:
http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: c3115765fe103b85e261eab4f5acd8e91fd3b7dd
Parent: a8ec3710d0e4e53bf466a1214e7c20d0f402b7e4
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Wed Sep 23 16:54:42 2009 +0200
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Wed Sep 23 16:54:42 2009 +0200
cman init: allow sshd to start before cman without hard dependency
In some scenarios this is very useful for debugging but we can't move
cman init startup priority or we will create a catch 22 with services.
Add CMAN_SSHD_START config variables that is user configurable and drives
sshd startup.
Fixes rhbz#494937
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
cman/init.d/cman.in | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/cman/init.d/cman.in b/cman/init.d/cman.in
index ed5a756..8788258 100644
--- a/cman/init.d/cman.in
+++ b/cman/init.d/cman.in
@@ -89,6 +89,12 @@ fi
# are found in @NOTIFYDDIR@
[ -z "$CMAN_NOTIFYD_START" ] && CMAN_NOTIFYD_START=conditional
+# CMAN_SSHD_START - control sshd startup behaviour
+# the variable can take 2 values:
+# yes | cman will start sshd as early as possible
+# no (default) | cman will not start sshd
+[ -z "$CMAN_SSHD_START" ] && CMAN_SSHD_START=no
+
# FENCE_JOIN_TIMEOUT -- seconds to wait for fence domain join to
# complete. If the join hasn't completed in this time, fence_tool join
# exits with an error, and this script exits with an error. To wait
@@ -251,6 +257,16 @@ stop_daemon()
### check functions (enable/disable) (on/off)
+sshd_enabled()
+{
+ case "$CMAN_SSHD_START" in
+ yes)
+ return 0
+ ;;
+ esac
+ return 1
+}
+
mtab_configfs()
{
awk '{ print $2 }' /etc/mtab | \
@@ -669,6 +685,8 @@ stop_fence_xvmd()
start()
{
+ sshd_enabled && service sshd start
+
if [ "$INITLOGLEVEL" = "quiet" ]; then
echoarg="-n"
fi