194 |
/* |
/* |
195 |
* Should we print debug information ? |
* Should we print debug information ? |
196 |
*/ |
*/ |
197 |
if(Run.debug && have_tty) { |
if(Run.debug && Run.have_tty) { |
198 |
|
|
199 |
printrunlist(); |
printrunlist(); |
200 |
printprocesslist(); |
printprocesslist(); |
272 |
} else if(is(action, "start")) { |
} else if(is(action, "start")) { |
273 |
|
|
274 |
if(P) { |
if(P) { |
275 |
if( exist_daemon() ) { |
if(exist_daemon()) { |
276 |
d_check_process(P, "start"); |
d_check_process(P, "start"); |
277 |
} else { |
} else { |
278 |
check_process(P, "start", TRUE); |
check_process(P, "start", TRUE); |
279 |
} |
} |
280 |
} else { |
} else { |
281 |
|
|
282 |
if(mygroup) |
if(Run.mygroup) |
283 |
control_group(mygroup, "start", TRUE); |
control_group(Run.mygroup, "start", TRUE); |
284 |
else |
else |
285 |
control("start", TRUE); |
control("start", TRUE); |
286 |
} |
} |
288 |
} else if(is(action, "stop")) { |
} else if(is(action, "stop")) { |
289 |
|
|
290 |
if(P) { |
if(P) { |
291 |
if( exist_daemon() ) { |
if(exist_daemon()) { |
292 |
d_check_process(P, "stop"); |
d_check_process(P, "stop"); |
293 |
} else { |
} else { |
294 |
check_process(P, "stop", TRUE); |
check_process(P, "stop", TRUE); |
295 |
} |
} |
296 |
} else { |
} else { |
297 |
|
|
298 |
if(mygroup) |
if(Run.mygroup) |
299 |
control_group(mygroup, "stop", TRUE); |
control_group(Run.mygroup, "stop", TRUE); |
300 |
else |
else |
301 |
control("stop", TRUE); |
control("stop", TRUE); |
302 |
} |
} |
314 |
|
|
315 |
} |
} |
316 |
|
|
317 |
if( exist_daemon() ) { |
if(exist_daemon()) { |
318 |
d_check_process(P, "stop"); |
d_check_process(P, "stop"); |
319 |
} else { |
} else { |
320 |
check_process(P, "stop", FALSE); |
check_process(P, "stop", FALSE); |
322 |
|
|
323 |
} else { |
} else { |
324 |
|
|
325 |
if(mygroup) |
if(Run.mygroup) |
326 |
control_group(mygroup, "stop", FALSE); |
control_group(Run.mygroup, "stop", FALSE); |
327 |
else |
else |
328 |
control("stop", FALSE); |
control("stop", FALSE); |
329 |
} |
} |
331 |
do_wait(); |
do_wait(); |
332 |
|
|
333 |
if(P) { |
if(P) { |
334 |
if( exist_daemon() ) { |
if(exist_daemon()) { |
335 |
d_check_process(P, "start"); |
d_check_process(P, "start"); |
336 |
} else { |
} else { |
337 |
check_process(P, "start", TRUE); |
check_process(P, "start", TRUE); |
338 |
} |
} |
339 |
} else { |
} else { |
340 |
|
|
341 |
if(mygroup) |
if(Run.mygroup) |
342 |
control_group(mygroup, "start", TRUE); |
control_group(Run.mygroup, "start", TRUE); |
343 |
else |
else |
344 |
control("start", TRUE); |
control("start", TRUE); |
345 |
} |
} |
346 |
|
|
347 |
} else if(is(action, "status")) { |
} else if(is(action, "status")) { |
348 |
|
|
349 |
if(mygroup) { |
if(Run.mygroup) { |
350 |
status_group(mygroup); |
status_group(Run.mygroup); |
351 |
} else { |
} else { |
352 |
status(); |
status(); |
353 |
} |
} |
498 |
|
|
499 |
stop_http(); |
stop_http(); |
500 |
|
|
501 |
} else if( !is(bind_addr, Run.bind_addr) || port != Run.httpdport ) { |
} else if(!is(bind_addr, Run.bind_addr) || port != Run.httpdport) { |
502 |
|
|
503 |
stop_http(); |
stop_http(); |
504 |
start_http(); |
start_http(); |
537 |
|
|
538 |
opterr= 0; |
opterr= 0; |
539 |
|
|
540 |
mygroup=0; |
Run.mygroup=0; |
541 |
|
|
542 |
while((rval= getopt(argc,argv,"c:d:g:l:iIvVh")) != -1) { |
while((rval= getopt(argc,argv,"c:d:g:l:iIvVh")) != -1) { |
543 |
|
|
560 |
break; |
break; |
561 |
|
|
562 |
case 'g': |
case 'g': |
563 |
mygroup= xstrdup(optarg); |
Run.mygroup= xstrdup(optarg); |
564 |
break; |
break; |
565 |
|
|
566 |
case 'l': |
case 'l': |
664 |
|
|
665 |
int i; |
int i; |
666 |
|
|
667 |
if(have_tty) { |
if(Run.have_tty) { |
668 |
|
|
669 |
fprintf(stdout, "Please wait for restart: "); |
fprintf(stdout, "Please wait for restart: "); |
670 |
|
|