96 |
static void handle_options(int, char **); /* Handle program options */ |
static void handle_options(int, char **); /* Handle program options */ |
97 |
static void help(); /* Print program help message to stdout */ |
static void help(); /* Print program help message to stdout */ |
98 |
static void version(); /* Print version information */ |
static void version(); /* Print version information */ |
|
static void stop_http(); /* Stop monit http */ |
|
|
static void start_http(); /* Start monit http */ |
|
99 |
|
|
100 |
|
|
101 |
/* ------------------------------------------------------------------ Public */ |
/* ------------------------------------------------------------------ Public */ |
314 |
|
|
315 |
if(! can_http()) { |
if(! can_http()) { |
316 |
|
|
317 |
stop_http(); |
monit_http(STOP_HTTP); |
318 |
|
|
319 |
} else if(!IS(bind_addr, Run.bind_addr) || port != Run.httpdport) { |
} else if(!IS(bind_addr, Run.bind_addr) || port != Run.httpdport) { |
320 |
|
|
321 |
stop_http(); |
monit_http(STOP_HTTP); |
322 |
start_http(); |
monit_http(START_HTTP); |
323 |
|
|
324 |
} else if(! check_httpd()) { |
} else if(! check_httpd()) { |
325 |
|
|
326 |
start_http(); |
monit_http(START_HTTP); |
327 |
|
|
328 |
} |
} |
329 |
|
|
546 |
/* Fall trough */ |
/* Fall trough */ |
547 |
case SIGTERM: |
case SIGTERM: |
548 |
if(Run.isdaemon && !Run.validate) { |
if(Run.isdaemon && !Run.validate) { |
549 |
if(Run.dohttpd) stop_http(); |
if(Run.dohttpd) monit_http(STOP_HTTP); |
550 |
log("%s daemon with pid [%d] killed\n", prog, (int)getpid()); |
log("%s daemon with pid [%d] killed\n", prog, (int)getpid()); |
551 |
finalize_files(); |
finalize_files(); |
552 |
state_finalize(); |
state_finalize(); |
592 |
state_update(); |
state_update(); |
593 |
|
|
594 |
if(can_http()) |
if(can_http()) |
595 |
start_http(); |
monit_http(START_HTTP); |
596 |
|
|
597 |
for(;;) { |
for(;;) { |
598 |
|
|
785 |
|
|
786 |
} |
} |
787 |
|
|
|
|
|
|
/** |
|
|
* Stop monit http |
|
|
*/ |
|
|
static void stop_http() { |
|
|
|
|
|
monit_http(STOP_HTTP); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
* Start monit http |
|
|
*/ |
|
|
static void start_http() { |
|
|
|
|
|
monit_http(START_HTTP); |
|
|
|
|
|
} |
|