-
-
Notifications
You must be signed in to change notification settings - Fork 427
SHUTDOWNEXIT flag for upsmon doesn't work on Windows #3084
Copy link
Copy link
Closed
Labels
Shutdowns and overrides and battery level triggersIssues and PRs about system shutdown, especially if battery charge/runtime remaining is involvedIssues and PRs about system shutdown, especially if battery charge/runtime remaining is involvedWindowsimpacts-release-2.8.4Issues reported against NUT release 2.8.4 (maybe vanilla or with minor packaging tweaks)Issues reported against NUT release 2.8.4 (maybe vanilla or with minor packaging tweaks)questionupsmon
Milestone
Metadata
Metadata
Assignees
Labels
Shutdowns and overrides and battery level triggersIssues and PRs about system shutdown, especially if battery charge/runtime remaining is involvedIssues and PRs about system shutdown, especially if battery charge/runtime remaining is involvedWindowsimpacts-release-2.8.4Issues reported against NUT release 2.8.4 (maybe vanilla or with minor packaging tweaks)Issues reported against NUT release 2.8.4 (maybe vanilla or with minor packaging tweaks)questionupsmon
I'm struggling with configuring secondary systems based on Windows. I've successfully installed NUT-Windows from release page (2.8.4) as Windows Service. NUT service is configured to be
netclient. upsmon is able to read config file successfully but shutdown design doesn't work as expectedI have RPi (CentOS Stream 9, NUT 2.8.3) as primary UPS controller and a bunch of secondary systems (Windows 7, 10 etc; NUT 2.8.4). Secondary systems drive heavy equipment which should be parked properly before shutdown. My plan is to use NUT as
netclientjust to catch FSD event on primary UPS and then execute equipment-specific script with consequent shutdown. For the test purposes I've created simple bash script which just emulates long shutdown process:On primary system I've set
HOSTSYNCto the number just a bit higher than required to properly shut down secondaries (1200). On the secondaries I haveSHUTDOWNEXITset to-1(also triedfalseand even big numbers like2000). According to the docs primary upsmon should wait until all secondaries disconnect (which should occur because I'm requesting Windows shutdown at the end of the process) and only then switch off itself and controlled UPS. However Windows logs tell me that secondary upsmon quits right after itsFINALDELAYcount of seconds which means two things: executing ofSHUTDOWNCMDdoesn't wait for it;SHUTDOWNEXITflag is ignored at all. Otherwise upsmon should live until Windows is powered off even in case of non-blockingsystem()call in upsmon code.I'm not sure if this is something special for Windows systems. As for me it looks like the only way to implement required shutdown design is to set
FINALDELAYon primary to the big enough number which guarantees that even the longest shutdown process among secondaries will end properly. But in that case I'm forced to wait predefined number of seconds even if shutdown of secondaries will complete even earlier.May be someone could point me in the right direction...