Closed lfxx closed 3 months ago
What is your exact use case (i.e. why do you actually need this)? Normally feature requests aren't accepted without a patch (see the README)
What is your exact use case (i.e. why do you actually need this)? Normally feature requests aren't accepted without a patch (see the README)
Thanks for replying.I have a program that has some bugs, and it occasionally crashes during execution. I use dinit to restart it and continue running when this happens. However, after the program runs successfully, I don't want it to be restarted continuously. I used to achieve this functionality with supervisor, but I couldn't find a way to do it in dinit.
Dinit has almost all the functionalities of supervisor and is very convenient to use. I have fully transitioned to using dinit in our production environment, and I prefer not to go back to supervisor. It would be great if the functionality I mentioned earlier could be implemented in dinit.
I won't be prioritising this, but it'd be easy enough to do (with a new service option). We can leave the issue open and maybe someone will pick it up.
I won't be prioritising this, but it'd be easy enough to do (with a new service option). We can leave the issue open and maybe someone will pick it up.
Ok.Could you please tag this issue? It would increase the likelihood of someone picking up this issue. Thank you.
@mobin-2008 feel free to adjust the labels if you think it's needed
I'm trying to implement a solution, My plan is to have a specific restart parameter as below:
...
restart = on-failure
this option checks for exit code of program and if it is something >0, Dinit won't restart that process. @lfxx Is it good enough for your usage?
I'm trying to implement a solution, My plan is to have a specific restart parameter as below:
... restart = on-failure
this option checks for exit code of program and if it is something >0, Dinit won't restart that process. @lfxx Is it good enough for your usage?
Yes,it is enough.Thank you!
Can Dinit implement a functionality similar to Supervisor's automatic restart on abnormal exit? Specifically, 1.when the program exits with a status code not present in the exitcode list, it should be considered an abnormal exit, triggering an automatic restart. 2.If the program exits normally with a status code within the exitcode list, no automatic restart is needed. Currently, Dinit automatically restarts in all situations, which is not very convenient.