threefoldtech / zinit

A init replacement that feels like runit written in rust+tokio
Apache License 2.0
10 stars 1 forks source link

Ctrl actions #4

Closed muhamadazmy closed 5 years ago

muhamadazmy commented 5 years ago

Add the ctrl command required to manage services life cycles

The PR also include some clean up and refactoring to separate the code. This is why it looks like it's a big PR while there is a huge part of it is just moving code around.

zaibon commented 5 years ago

When I do a status command, the state value looks odd. Looks like a printed object, is this format intended ?

state: Error(Signaled(Pid(283), SIGTERM, false))
zaibon commented 5 years ago

Regarding the start stop command output, I would add if possible the result of the action. So the user is aware if something bad appended after a start or stop.

muhamadazmy commented 5 years ago

When I do a status command, the state value looks odd. Looks like a printed object, is this format intended ?

state: Error(Signaled(Pid(283), SIGTERM, false))

No, the format is not intended, it's indeed the printed cause of the error. in that case it seems the process exited duo to a signal and didn't shutdown gracefully.

Regarding the start stop command output, I would add if possible the result of the action. So the user is aware if something bad appended after a start or stop.

Please check the documentations for what stop exactly does. Note that the ctrl command exits on success with code 0. If something went wrong, a different exit code and an error message will be printed.