summaryrefslogtreecommitdiffstats
path: root/ctdb
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2009-02-04 00:42:33 +0100
committerMichael Adam <obnox@samba.org>2009-02-04 00:42:33 +0100
commit0405ec036d82f55f2fc816bb1ffcf07b74fa8b86 (patch)
tree19881490a934960419fc6d6b430709160d7633b2 /ctdb
parentfe8a4350b0d0cd185185aeb8ecb79590b4c9a456 (diff)
downloadsamba-0405ec036d82f55f2fc816bb1ffcf07b74fa8b86.tar.gz
samba-0405ec036d82f55f2fc816bb1ffcf07b74fa8b86.tar.xz
samba-0405ec036d82f55f2fc816bb1ffcf07b74fa8b86.zip
events 41.httpd: support suse and ubuntu/debian systems for managing apache
The httpd service on suse and ubuntu/debian systems is usually called "apache2" nowadays. Note: There are older installs with Apache 1.3 out there, in which case the service is called "apache". An extra check for these installs could be useful as a sequel to this patch... Michael (This used to be ctdb commit b9e50e3416fecef6a881be3f1b91be977299293f)
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)