290 |
|
|
291 |
stop_http(); |
stop_http(); |
292 |
|
|
293 |
} else if(!is(bind_addr, Run.bind_addr) || port != Run.httpdport) { |
} else if(!IS(bind_addr, Run.bind_addr) || port != Run.httpdport) { |
294 |
|
|
295 |
stop_http(); |
stop_http(); |
296 |
start_http(); |
start_http(); |
318 |
|
|
319 |
do_default(); |
do_default(); |
320 |
|
|
321 |
} else if(is(action, "start")) { |
} else if(IS(action, "start")) { |
322 |
|
|
323 |
if(P) { |
if(P) { |
324 |
if(exist_daemon()) { |
if(exist_daemon()) { |
334 |
control("start"); |
control("start"); |
335 |
} |
} |
336 |
|
|
337 |
} else if(is(action, "stop")) { |
} else if(IS(action, "stop")) { |
338 |
|
|
339 |
if(P) { |
if(P) { |
340 |
if(exist_daemon()) { |
if(exist_daemon()) { |
350 |
control("stop"); |
control("stop"); |
351 |
} |
} |
352 |
|
|
353 |
} else if(is(action, "reload")) { |
} else if(IS(action, "reload")) { |
354 |
|
|
355 |
error("Reinitializing monit daemon\n", prog); |
error("Reinitializing monit daemon\n", prog); |
356 |
kill_daemon(SIGHUP); |
kill_daemon(SIGHUP); |
357 |
|
|
358 |
} else if(is(action, "restart")) { |
} else if(IS(action, "restart")) { |
359 |
|
|
360 |
if(P) { |
if(P) { |
361 |
|
|
382 |
control("restart"); |
control("restart"); |
383 |
} |
} |
384 |
|
|
385 |
} else if(is(action, "status")) { |
} else if(IS(action, "status")) { |
386 |
|
|
387 |
if(Run.mygroup) { |
if(Run.mygroup) { |
388 |
status_group(Run.mygroup); |
status_group(Run.mygroup); |
390 |
status(); |
status(); |
391 |
} |
} |
392 |
|
|
393 |
} else if(is(action, "quit")) { |
} else if(IS(action, "quit")) { |
394 |
|
|
395 |
error("Stopping monit daemon\n", prog); |
error("Stopping monit daemon\n", prog); |
396 |
kill_daemon(SIGTERM); |
kill_daemon(SIGTERM); |
397 |
|
|
398 |
} else if(is(action, "validate")) { |
} else if(IS(action, "validate")) { |
399 |
|
|
400 |
validate(); |
validate(); |
401 |
|
|
596 |
|
|
597 |
case 'l': |
case 'l': |
598 |
Run.logfile= xstrdup(optarg); |
Run.logfile= xstrdup(optarg); |
599 |
if(is(Run.logfile, "syslog")) |
if(IS(Run.logfile, "syslog")) |
600 |
Run.use_syslog= TRUE; |
Run.use_syslog= TRUE; |
601 |
Run.dolog= TRUE; |
Run.dolog= TRUE; |
602 |
break; |
break; |