You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to be able to use the oncrash option to run a script in this specific case. I think this is more useful than restarting because you can do some logging or other tasks before requesting a restart.
Is this possibly on the list for 4.4?
The text was updated successfully, but these errors were encountered:
Yea, I was thinking that it could work in exactly that way.
I do think it might be valuable to know the EXIT_CODE of the script though, that might tell the script information of why it crashed (sometimes). It might make sense to set another variable? e.g. SERVICE_CRASHED="yes" maybe?
From the current manual, EXIT_CODE is already used like this (naming is what it is, unfortunately):
The scripts are not called with any argument (currently), but both get the SERVICE_IDENT=foo environment variable set. Here foo denotes the
identity of the service, which if there are multiple services named foo,
may be foo:1, or any unique identifier specified in the .conf file. The post:script is called with an additional set of environment variables:
EXIT_CODE=[exited,signal]: set to one of exited or signal
EXIT_STATUS=[num,SIGNAME]: set to one of exit status code from
the program, if it exited normally, or the signal name (HUP, TERM, etc.) if it exited due to signal
My idea was adding crashing (or crashed) so that you can set up a switch case of $EXIT_CODE to handle the various cases. This way you could use the same script for handling pre/post setup and teardown, and now also crashing.
I would like to be able to use the oncrash option to run a script in this specific case. I think this is more useful than restarting because you can do some logging or other tasks before requesting a restart.
Is this possibly on the list for 4.4?
The text was updated successfully, but these errors were encountered: