532 |
|
|
533 |
struct myprocess *p= get_process(name); |
struct myprocess *p= get_process(name); |
534 |
|
|
535 |
if(is(action, "start") || is(action, "stop")) { |
if( is(action, "start") ) { |
536 |
|
|
537 |
check_process(name, action, TRUE); |
if(p->start) |
538 |
|
|
539 |
|
check_process(name, action, TRUE); |
540 |
|
|
541 |
|
else { |
542 |
|
|
543 |
|
send_error(res, SC_BAD_REQUEST, |
544 |
|
"Start method not defined for the process"); |
545 |
|
goto quit; |
546 |
|
|
547 |
|
} |
548 |
|
|
549 |
} |
} |
550 |
|
|
551 |
|
if( is(action, "stop") ) { |
552 |
|
|
553 |
|
if(p->stop) |
554 |
|
|
555 |
|
check_process(name, action, TRUE); |
556 |
|
|
557 |
|
else { |
558 |
|
|
559 |
|
send_error(res, SC_BAD_REQUEST, |
560 |
|
"Stop method not defined for the process"); |
561 |
|
goto quit; |
562 |
|
|
563 |
|
} |
564 |
|
|
565 |
|
} |
566 |
|
|
567 |
if(is(action, "status")) { |
if(is(action, "status")) { |
568 |
|
|
569 |
print_status(p, res); |
print_status(p, res); |