179 |
|
|
180 |
if(IS(action, "start")) { |
if(IS(action, "start")) { |
181 |
|
|
182 |
if(s->task==TASK_PROCESS && is_process_running(s)) { |
if(s->type==TYPE_PROCESS && is_process_running(s)) { |
183 |
|
|
184 |
if(!s->do_monitor) { |
if(!s->do_monitor) { |
185 |
|
|
194 |
return; |
return; |
195 |
} |
} |
196 |
|
|
197 |
if(s->task==TASK_PROCESS && !s->start) { |
if(s->type==TYPE_PROCESS && !s->start) { |
198 |
DEBUG("%s: Start method not defined -- process %s\n", |
DEBUG("%s: Start method not defined -- process %s\n", |
199 |
prog, P); |
prog, P); |
200 |
return; |
return; |
206 |
|
|
207 |
} else if(IS(action, "stop")) { |
} else if(IS(action, "stop")) { |
208 |
|
|
209 |
if(s->task==TASK_PROCESS && !s->stop) { |
if(s->type==TYPE_PROCESS && !s->stop) { |
210 |
DEBUG("%s: Stop method not defined -- process %s\n", |
DEBUG("%s: Stop method not defined -- process %s\n", |
211 |
prog, P); |
prog, P); |
212 |
return; |
return; |
217 |
|
|
218 |
} else if(IS(action, "restart")) { |
} else if(IS(action, "restart")) { |
219 |
|
|
220 |
if(s->task==TASK_PROCESS && (!s->start || !s->stop)) { |
if(s->type==TYPE_PROCESS && (!s->start || !s->stop)) { |
221 |
DEBUG("%s: Start or stop method not defined -- process %s\n", |
DEBUG("%s: Start or stop method not defined -- process %s\n", |
222 |
prog, P); |
prog, P); |
223 |
return; |
return; |
282 |
} |
} |
283 |
} |
} |
284 |
|
|
285 |
if(s->start && (s->task==TASK_PROCESS || !is_process_running(s))) { |
if(s->start && (s->type==TYPE_PROCESS || !is_process_running(s))) { |
286 |
int status; |
int status; |
287 |
pthread_t thread; |
pthread_t thread; |
288 |
log("start: (%s) %s\n", s->name, s->start->arg[0]); |
log("start: (%s) %s\n", s->name, s->start->arg[0]); |
326 |
/* Reset the proc info object in case of a later restart */ |
/* Reset the proc info object in case of a later restart */ |
327 |
memset(s->procinfo, 0, sizeof *(s->procinfo)); |
memset(s->procinfo, 0, sizeof *(s->procinfo)); |
328 |
|
|
329 |
if(s->stop && (s->task==TASK_PROCESS || is_process_running(s))) { |
if(s->stop && (s->type==TYPE_PROCESS || is_process_running(s))) { |
330 |
log("stop: (%s) %s\n", s->name, s->stop->arg[0]); |
log("stop: (%s) %s\n", s->name, s->stop->arg[0]); |
331 |
spawn(s, s->stop); |
spawn(s, s->stop); |
332 |
|
|