138 |
status= pthread_mutex_init(&Run.mutex, NULL); |
status= pthread_mutex_init(&Run.mutex, NULL); |
139 |
if(status != 0) { |
if(status != 0) { |
140 |
|
|
141 |
error("%s: Cannot initialize mutex -- %s\n", prog, strerror(status)); |
log("%s: Cannot initialize mutex -- %s\n", prog, strerror(status)); |
142 |
exit(1); |
exit(1); |
143 |
|
|
144 |
} |
} |
161 |
* Start the Parser and create the process list. This will also set |
* Start the Parser and create the process list. This will also set |
162 |
* any Runtime constants defined in the controlfile. |
* any Runtime constants defined in the controlfile. |
163 |
*/ |
*/ |
|
|
|
164 |
if(! parse(Run.controlfile)) { |
if(! parse(Run.controlfile)) { |
|
log("I should only be here once\n"); |
|
165 |
|
|
166 |
exit(1); |
exit(1); |
167 |
|
|
181 |
*/ |
*/ |
182 |
if(! processlist) { |
if(! processlist) { |
183 |
|
|
184 |
error("%s: No programs have been specified\n", prog); |
log("%s: No programs have been specified\n", prog); |
185 |
exit(0); |
exit(0); |
186 |
|
|
187 |
} |
} |
239 |
/* Did we find any process ? */ |
/* Did we find any process ? */ |
240 |
if(! processlist) { |
if(! processlist) { |
241 |
|
|
242 |
error("%s: No programs have been specified\n", prog); |
log("%s: No programs have been specified\n", prog); |
243 |
exit(0); |
exit(0); |
244 |
|
|
245 |
} |
} |
354 |
|
|
355 |
} else if(is(action, "quit")) { |
} else if(is(action, "quit")) { |
356 |
|
|
357 |
log("Stopping monit daemon\n", prog); |
error("Stopping monit daemon\n", prog); |
358 |
kill_daemon(); |
kill_daemon(); |
359 |
|
|
360 |
} else if(is(action, "validate")) { |
} else if(is(action, "validate")) { |
457 |
|
|
458 |
if(can_http()) { |
if(can_http()) { |
459 |
|
|
460 |
printf("Starting httpd at [%s:%d]\n", Run.bind_addr?Run.bind_addr:"*", Run.httpdport); |
printf("Starting httpd at [%s:%d]\n", |
461 |
|
Run.bind_addr?Run.bind_addr:"*", Run.httpdport); |
462 |
|
|
463 |
} |
} |
464 |
|
|