1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-14 19:24:43 +03:00
Michael Adam 0405ec036d 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)
2009-02-04 00:42:33 +01:00

54 lines
886 B
Bash
Executable File

#!/bin/sh
# event script to manage httpd in a cluster environment
. $CTDB_BASE/functions
loadconfig ctdb
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
cmd="$1"
shift
case $cmd in
startup)
service "${CTDB_SERVICE_HTTP}" stop > /dev/null 2>&1
service "${CTDB_SERVICE_HTTP}" start
;;
shutdown)
service "${CTDB_SERVICE_HTTP}" stop
;;
monitor)
ctdb_check_tcp_ports "http" 80
;;
esac
exit 0