add eventscript for http
authorRonnie Sahlberg <sahlberg@ronnie>
Thu, 10 Jan 2008 23:44:16 +0000 (10:44 +1100)
committerRonnie Sahlberg <sahlberg@ronnie>
Thu, 10 Jan 2008 23:44:16 +0000 (10:44 +1100)
Makefile.in
config/ctdb.sysconfig
config/events.d/41.httpd [new file with mode: 0644]
packaging/RPM/ctdb.spec

index ba0d1ba2e56ab623cdf4c08b16835d35714c1fcf..ba5eab69dde1f64febcb5a050d842d98ea6766fe 100644 (file)
@@ -177,6 +177,7 @@ install: all
        ${INSTALLCMD} -m 755 config/events.d/00.ctdb $(DESTDIR)$(etcdir)/ctdb/events.d
        ${INSTALLCMD} -m 755 config/events.d/10.interface $(DESTDIR)$(etcdir)/ctdb/events.d
        ${INSTALLCMD} -m 755 config/events.d/40.vsftpd $(DESTDIR)$(etcdir)/ctdb/events.d
+       ${INSTALLCMD} -m 755 config/events.d/41.httpd $(DESTDIR)$(etcdir)/ctdb/events.d
        ${INSTALLCMD} -m 755 config/events.d/50.samba $(DESTDIR)$(etcdir)/ctdb/events.d
        ${INSTALLCMD} -m 755 config/events.d/60.nfs $(DESTDIR)$(etcdir)/ctdb/events.d
        ${INSTALLCMD} -m 755 config/events.d/61.nfstickle $(DESTDIR)$(etcdir)/ctdb/events.d
index 9306884b642bb542b447689ccb2955101ce8a2da..f236cda6e72a0ea6e675b82179aca8ad4e53ee2b 100644 (file)
 # default is to not manage Samba
 # CTDB_MANAGES_SAMBA=yes
 
+# should ctdb manage starting/stopping the http service for you?
+# default is to not manage http 
+# CTDB_MANAGES_HTTPD=yes
+
 # should ctdb manage starting/stopping Winbind service?
 # if left comented out then it will be autodetected based on smb.conf
 # CTDB_MANAGES_WINBIND=yes
diff --git a/config/events.d/41.httpd b/config/events.d/41.httpd
new file mode 100644 (file)
index 0000000..d9e82b0
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/sh
+# event strict to manage httpd in a cluster environment
+
+. $CTDB_BASE/functions
+loadconfig ctdb
+
+[ "$CTDB_MANAGES_HTTPD" = "yes" ] || exit 0
+
+cmd="$1"
+shift
+
+case $cmd in 
+     startup)
+        service httpd stop > /dev/null 2>&1
+        service httpd start
+        ;;
+
+     shutdown)
+        service httpd stop
+        ;;
+
+     monitor)
+        ctdb_check_tcp_ports "http" 80
+        ;;
+esac
+
+exit 0
+
index 10224d09d60d9eab887cec59dd6ea571fca418d5..782f6925df77b0086188f2d257c8264c21524413 100644 (file)
@@ -97,6 +97,7 @@ fi
 %{_sysconfdir}/ctdb/events.d/00.ctdb
 %{_sysconfdir}/ctdb/events.d/10.interface
 %{_sysconfdir}/ctdb/events.d/40.vsftpd
+%{_sysconfdir}/ctdb/events.d/41.httpd
 %{_sysconfdir}/ctdb/events.d/50.samba
 %{_sysconfdir}/ctdb/events.d/60.nfs
 %{_sysconfdir}/ctdb/events.d/61.nfstickle