-
-
Notifications
You must be signed in to change notification settings - Fork 413
Description
following #200, @yclauzel has found another minor bug in the NUT driver startup flow, that is a behavior regression considering the previous sysV init one:
When 1 driver, at least, fails to start, upsdrvctl currently returns EXIT_FAILURE.
This results in systemd considering the whole nut-driver unit to have failed, and in turn nut-server unit is not started.
Previously, driver(s) were started in best effort mode, and then upsd.
Solution:
- Implement a verification in upsdrvctl: if at least 1 driver has succeeded, exit code will be 2. If all driver(s) have failed, return as currently with EXIT_FAILURE (code 1). Success code (0) is unchanged
- document these modifications in upsdrvctl manual page
- Add the following field to the nut-driver.service file, in the [Service] section
SuccessExitStatus=2
I'll be pushing these proposed changes in a separate branch, while waiting for feedback.
This should not lead to regression in users integration, since most (if not all) people should be testing for a non-zero return code to check for errors. However, this will solve another systemd integration point.
@clepple , @zykh , @balooloo , @bigon : calling for review and approval. thx!