NUT shutdowns down UPS on reboot (includes fix)
I have NUT connected via USB to a UPS, and when I reboot the computer, the UPS will shut down.
The reason is that /lib/systemd/
/sbin/upsdrvctl shutdown
Since the script is called with one of the following options: poweroff, halt, reboot, kexec, I have made it conditional:
Replace line 13, which just contains the shutdown command, with:
case "${1} in
poweroff|
/sbin/upsdrvctl shutdown
;;
reboot)
/sbin/upsdrvctl stop
;;
esac
The result is that if you are rebooting, it will not shutdown the UPS, only the service, but in all other cases it will.
Maybe kexec would want the same treatment?
My logic behind this is that if I am rebooting the server, I am unconditionally stating I wish to continue running, and shutting down the UPS makes no sense then, and does invariably lead to a shutdown while the server is starting up.
// Stefan
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Ubuntu nut Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Stefan Smietanowski
- Solved:
- Last query:
- Last reply: