Eventscripts: improvements to 41.httpd.
authorMartin Schwenke <martin@meltin.net>
Thu, 13 Jan 2011 22:43:01 +0000 (09:43 +1100)
committerMartin Schwenke <martin@meltin.net>
Thu, 11 Aug 2011 00:46:56 +0000 (10:46 +1000)
* Reduce the failure counts so that restart attempts happen sooner.

* Use service_start() and service_stop() for the restart.
  ctdb_service_start() resets the failure count, which isn't very
  useful in this context.

Signed-off-by: Martin Schwenke <martin@meltin.net>
config/events.d/41.httpd

index 2006210cd58b5d96796b081b061fca12936baa7a..6ae5d61b30d7b2dbe88374a148d7f5e6d3f0f98f 100755 (executable)
@@ -61,16 +61,16 @@ case "$1" in
        else
            ctdb_counter_incr
 
-           ctdb_check_counter_equal 5 || {
+           ctdb_check_counter warn -eq 2 || {
                echo "HTTPD is not running. Trying to restart HTTPD."
-               ctdb_service_stop
-               ctdb_service_start
+               service_stop
+               service_start
                exit 0
            }
-            ctdb_check_counter_limit 10 quiet|| {
+            ctdb_check_counter warn -ge 5 || {
                echo "HTTPD is not running. Trying to restart HTTPD."
-               ctdb_service_stop
-               ctdb_service_start
+               service_stop
+               service_start
                exit 1
            }
        fi