summaryrefslogtreecommitdiffstats
path: root/ctdb
diff options
context:
space:
mode:
Diffstat (limited to 'ctdb')
-rwxr-xr-xctdb/config/events.d/41.httpd32
1 files changed, 28 insertions, 4 deletions
diff --git a/ctdb/config/events.d/41.httpd b/ctdb/config/events.d/41.httpd
index 5f244d1074..fae9f47f55 100755
--- a/ctdb/config/events.d/41.httpd
+++ b/ctdb/config/events.d/41.httpd
@@ -3,7 +3,31 @@
. $CTDB_BASE/functions
loadconfig ctdb
-loadconfig http
+
+detect_init_style
+
+case $CTDB_INIT_STYLE in
+ redhat)
+ CTDB_SERVICE_HTTP="httpd"
+ CTDB_CONFIG_HTTP="http"
+ ;;
+ suse)
+ CTDB_SERVICE_HTTP="apache2"
+ CTDB_CONFIG_HTTP="apache2"
+ ;;
+ ubuntu)
+ CTDB_SERVICE_HTTP="apache2"
+ CTDB_CONFIG_HTTP="apache2"
+ ;;
+ *)
+ # should not happen.
+ # for now use red hat style as default
+ CTDB_SERVICE_HTTP="httpd"
+ CTDB_CONFIG_HTTP="http"
+ ;;
+esac
+
+loadconfig "${CTDB_CONFIG_HTTP}"
[ "$CTDB_MANAGES_HTTPD" = "yes" ] || exit 0
@@ -12,12 +36,12 @@ shift
case $cmd in
startup)
- service httpd stop > /dev/null 2>&1
- service httpd start
+ service "${CTDB_SERVICE_HTTP}" stop > /dev/null 2>&1
+ service "${CTDB_SERVICE_HTTP}" start
;;
shutdown)
- service httpd stop
+ service "${CTDB_SERVICE_HTTP}" stop
;;
monitor)