-
-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
<task/<NAME>/failure> should also set error code in condition #276
Comments
clearing conditions then might be slightly more tricky than currently, you would have to do (if in bash): |
No, that's not what the conditions system is supposed to do. Not to mention the unnecessary complexity it would add. I'd much rather see we handle this as part of #273 instead. |
So your thinking is that with the above fix, there can be a catchall script run upon failure which then checks the errorcode using initctl -s status and takes action that way? |
Yes exactly, 1) task failed, start script, 2) check exit status (and/or state) of task. This moves a lot of the logic to initctl, instead of squeezing it into PID 1. Does that make sense for your use-case? |
Yep, that would work fine thanks! |
It would be great if when a task fails, that we can set a condition based on the failure code. This way specific scripts can be done to deal with the results.
For example, lets say we have a script which checks whether a hardware has failed. It can return 0 (success) or (failure) with exit code 1,2,3 so it would be great if for example it failed with error code 1 then it set both
<task/<NAME>/failure>
and<task/<NAME>/failure:1>
error code 2 would look like:
<task/<NAME>/failure>
and<task/<NAME>/failure:2>
etc
This would allow specific scripts to run if you know in advance what the error code might be. If you don't know, you can still using the existing
<task/<NAME>/failure>
condition.The text was updated successfully, but these errors were encountered: