I have nut which installed on Debian 8 host. The host is connected with UPS. In general everything works as expected. If UPS works on line, upsc shows the corresponding status. If UPS works on battery, upsc again shows the corresponding status. But if UPS has low battery status, upsc shows the corresponding status and (!) host shuts down even if I haven't asked nut for such behaviour.Which part of nut (upsmon, upssched, or something else) is responsible for such behaviour?
Unexpected system shutdown with low battery UPS status
ups;nut
In the Network UPS Tools User Manual pdf, section 6.3.1 Shutdown design, it describes the algorithm used. The important point is that if the ups is on battery, and also the battery charge is low, this is critical, and means that soon there will be no power at all, so a shutdown is started.On low battery, upsmon sets FSD (forced shutdown sequence), generates aNOTIFY_SHUTDOWN event, waits FINALDELAY seconds, creates the POWERDOWNFLAGfile /etc/killpower, calls SHUTDOWNCMD. These values are set in /etc/ups/upsmon.conf.On some ups devices, you can change the value of the low battery signal point. To list the variables for, say, device myups:$ upsrw myups[battery.charge.low]Remaining battery level when UPS switches to LB (percent)Type: STRINGMaximum length: 5Value: 20...This example shows low battery is signalled when 20% charge is left. To change this to 10% you need the nut user and password you configured in /etc/ups/upsd.users, then you can do, eg:$ upsrw -u mynutuser -p mynutpassword -s battery.charge.low=10 myupsOK$ upsrw myups | grep -A4 battery.charge.low[battery.charge.low]Remaining battery level when UPS switches to LB (percent)Type: STRINGMaximum length: 5Value: 10