537 |
|
|
538 |
if( is(action, "start") ) { |
if( is(action, "start") ) { |
539 |
|
|
540 |
if(p->start) |
if(p->start) { |
541 |
|
|
542 |
check_process(name, action); |
LOCK(p->mutex) |
543 |
|
check_process(name, action); |
544 |
|
END_LOCK; |
545 |
|
|
546 |
else { |
} else { |
547 |
|
|
548 |
send_error(res, SC_BAD_REQUEST, |
send_error(res, SC_BAD_REQUEST, |
549 |
"Start method not defined for the process"); |
"Start method not defined for the process"); |
555 |
|
|
556 |
if( is(action, "stop") ) { |
if( is(action, "stop") ) { |
557 |
|
|
558 |
if(p->stop) |
if(p->stop) { |
559 |
|
|
560 |
check_process(name, action); |
LOCK(p->mutex) |
561 |
|
check_process(name, action); |
562 |
|
END_LOCK; |
563 |
|
|
564 |
else { |
} else { |
565 |
|
|
566 |
send_error(res, SC_BAD_REQUEST, |
send_error(res, SC_BAD_REQUEST, |
567 |
"Stop method not defined for the process"); |
"Stop method not defined for the process"); |
574 |
if( is(action, "restart") ) { |
if( is(action, "restart") ) { |
575 |
|
|
576 |
if(p->start && p->stop) { |
if(p->start && p->stop) { |
577 |
|
|
578 |
check_process(name, action); |
LOCK(p->mutex) |
579 |
|
check_process(name, action); |
580 |
|
END_LOCK; |
581 |
|
|
582 |
} else { |
} else { |
583 |
|
|