2 # event script to manage httpd in a cluster environment
8 case $CTDB_INIT_STYLE in
14 service_name="apache2"
15 service_config="apache2"
19 # RHEL5 sometimes use a SIGKILL to terminate httpd, which then leaks
20 # semaphores. This is a hack to clean them up.
21 cleanup_httpd_semaphore_leak() {
22 killall -q -0 "$service_name" ||
23 for i in $(ipcs -s | awk '$3 == "apache" { print $2 }') ; do
32 cleanup_httpd_semaphore_leak
33 service $service_name start
37 service $service_name stop
38 killall -q -9 $service_name || true
43 ctdb_start_stop_service
45 is_ctdb_managed_service || exit 0
47 ctdb_service_check_reconfigure
59 if ctdb_check_tcp_ports 80 >/dev/null 2>/dev/null ; then
64 ctdb_check_counter warn -eq 2 || {
65 echo "HTTPD is not running. Trying to restart HTTPD."
70 ctdb_check_counter warn -ge 5 || {
71 echo "HTTPD is not running. Trying to restart HTTPD."
80 ctdb_standard_event_handler "$@"