~ubuntu-branches/ubuntu/vivid/ctdb/vivid-proposed

« back to all changes in this revision

Viewing changes to config/events.d/41.httpd

  • Committer: Package Import Robot
  • Author(s): Mathieu Parent
  • Date: 2011-11-06 15:18:59 UTC
  • mto: (1.3.1)
  • mto: This revision was merged to the branch mainline in revision 22.
  • Revision ID: package-import@ubuntu.com-20111106151859-84nk51h3enndlo4q
Tags: upstream-1.11+git20111102
ImportĀ upstreamĀ versionĀ 1.11+git20111102

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 
28
28
##########
29
29
 
30
 
service_start="cleanup_httpd_semaphore_leak; service $service_name start"
31
 
service_stop="service $service_name stop; killall -q -9 $service_name || true"
32
 
service_reconfigure="service $service_name restart"
 
30
service_start ()
 
31
{
 
32
    cleanup_httpd_semaphore_leak
 
33
    service $service_name start
 
34
}
 
35
service_stop ()
 
36
{
 
37
    service $service_name stop
 
38
    killall -q -9 $service_name || true
 
39
}
33
40
 
34
41
loadconfig
35
42
 
37
44
 
38
45
is_ctdb_managed_service || exit 0
39
46
 
 
47
ctdb_service_check_reconfigure
 
48
 
40
49
case "$1" in
41
50
    startup)
42
51
        ctdb_service_start
47
56
        ;;
48
57
 
49
58
    monitor)
50
 
        if ctdb_service_needs_reconfigure ; then
51
 
            ctdb_service_reconfigure
52
 
            exit 0
53
 
        fi
54
 
 
55
59
        if ctdb_check_tcp_ports 80 >/dev/null 2>/dev/null ; then
56
60
            ctdb_counter_init
57
61
        else
58
62
            ctdb_counter_incr
59
63
 
60
 
            ctdb_check_counter_equal 5 || {
 
64
            ctdb_check_counter warn -eq 2 || {
61
65
                echo "HTTPD is not running. Trying to restart HTTPD."
62
 
                ctdb_service_stop
63
 
                ctdb_service_start
 
66
                service_stop
 
67
                service_start
64
68
                exit 0
65
69
            }
66
 
            ctdb_check_counter_limit 10 quiet|| {
 
70
            ctdb_check_counter warn -ge 5 || {
67
71
                echo "HTTPD is not running. Trying to restart HTTPD."
68
 
                ctdb_service_stop
69
 
                ctdb_service_start
 
72
                service_stop
 
73
                service_start
70
74
                exit 1
71
75
            }
72
76
        fi