mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-08-25 17:55:21 +00:00
nixos/ups: run killpower driver as root
upsdrv starts the driver with `upsdrvctl -u root start`, but
ups-killpower invokes a bare `upsdrvctl shutdown`. Since nut
is built --with-user=nutmon, nut fails to read both /var/lib/nut
and the USB device with "insufficient permissions on everything".
The UPS is then never told to cut its outlets: it keeps draining
battery after the OS has halted, and cannot power-cycle the machine
when mains returns.
Ergo, run the shutdown as root.
(cherry picked from commit f4d444ddff)
This commit is contained in:
committed by
github-actions[bot]
parent
b708157eca
commit
e5f495b69b
@@ -679,7 +679,7 @@ in
|
||||
environment = envVars;
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${cfg.package}/bin/upsdrvctl shutdown";
|
||||
ExecStart = "${cfg.package}/bin/upsdrvctl -u root shutdown";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user