Uninterruptible power supply: Difference between revisions
→Declare UPS units: rationale |
Starfish2228 (talk | contribs) →Delay UPS Shutdown: remove redundant section, as similar code is already present in NixOS |
||
| (13 intermediate revisions by 4 users not shown) | |||
| Line 50: | Line 50: | ||
* upsd.conf, control access to upsd, power.ups.upsd option | * upsd.conf, control access to upsd, power.ups.upsd option | ||
* upsd.users, add user with access to upsd, power.ups.users option | * upsd.users, add user with access to upsd, power.ups.users option | ||
* upsmon.conf, connect to upsd, power.ups.upsmon.monitor section; | * upsmon.conf, connect upsmon to upsd, power.ups.upsmon.monitor section; | ||
* upsmon.conf, set how upsmon should react to status changes, power.ups.upsmon.settings section | * upsmon.conf, set how upsmon should react to status changes, power.ups.upsmon.settings section | ||
* delayed UPS shutdown systemd unit, to make Restore Power on AC Return BIOS option functional, systemd.services.nut-delayed-ups-shutdown section | * delayed UPS shutdown systemd unit, to make Restore Power on AC Return BIOS option functional, systemd.services.nut-delayed-ups-shutdown section | ||
| Line 63: | Line 63: | ||
# this UPS device is named UPS-1. | # this UPS device is named UPS-1. | ||
ups."UPS-1" = { | ups."UPS-1" = { | ||
description = "Eaton Ellipse ECO 650 with 12V 7Ah Batt"; | description = "Eaton Ellipse ECO 650 with 12V 7Ah lead-acid Batt"; | ||
# driver name from https://networkupstools.org/stable-hcl.html | # driver name from https://networkupstools.org/stable-hcl.html | ||
| Line 94: | Line 94: | ||
# upsmon initiate shutdown once this threshold is reached. | # upsmon initiate shutdown once this threshold is reached. | ||
"lowbatt = 40" | "lowbatt = 40" | ||
# ignore it if the UPS reports a low battery condition | |||
# without this, system will shutdown only when ups reports lb, | |||
# not respecting lowbatt option | |||
"ignorelb" | |||
]; | ]; | ||
}; | }; | ||
| Line 127: | Line 132: | ||
# declarations. upsd.users | # declarations. upsd.users | ||
users."nut-admin" = { | users."nut-admin" = { | ||
passwordFile = | # A file that contains just the password. | ||
passwordFile = "/etc/nixos/ups-passwd.txt"; | |||
upsmon = "primary"; | upsmon = "primary"; | ||
}; | }; | ||
| Line 142: | Line 148: | ||
powerValue = 1; | powerValue = 1; | ||
user = "nut-admin"; | user = "nut-admin"; | ||
passwordFile = | passwordFile = "/etc/nixos/ups-passwd.txt"; | ||
type = "primary"; | type = "primary"; | ||
}; | }; | ||
| Line 199: | Line 205: | ||
}; | }; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
[[Category:Hardware]] | |||