make stop command return after process end.
if not, restart command will stop process, but will not start the new process (because process being terminated is detected by start function)