Your message dated Wed, 04 Nov 2026 17:32:06 +0000
with message-id <[email protected]>
and subject line Bug#1056190: fixed in nut 2.8.1-5+deb13u1
has caused the Debian Bug report #1056190,
regarding /sbin/upsmon: CAL flag in UPSMON never cleared, shutdown procedure 
will not be triggered
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
1056190: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1056190
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: nut-client
Version: 2.8.0-7
Severity: important
File: /sbin/upsmon
X-Debbugs-Cc: [email protected]

Dear Maintainer,


   * What led up to the situation?

        During a power cut long enough to bring my UPS batteries to a
        critical level, I noticed that my server was not shut down by
        NUT as I expected.

   * What exactly did you do (or not do) that was effective (or
     ineffective)?

        An UPS is connected to the server and managed by NUT.
        (daemon /sbin/upsmon = nut-monitor)
        NUT is configured to switch off the server in "low battery"
        state.
        The UPS regularly performs a battery self-test, which is
        recognized by UPSMON as a calibration.
        A few days later, there was a power cut.

   * What was the outcome of this action?

        During a power cut long enough to bring the battery level to a
        critical threshold, UPSMON didn't initiate the shutdown
        procedure because it thought the UPS was still in calibration,
        which was wrong, and the server was finally abruptly power down when
        the battery was drained.

   * What outcome did you expect instead?

        When the battery charge level reached a threshold defined as "low
        battery", UPSMON should have initiated the server shutdown procedure.


This bug is known on the github of networkupstools here :
        https://github.com/networkupstools/nut/issues/2168
Bug fix here :
        
https://github.com/networkupstools/nut/pull/2169/commits/b606d757660b85ba9123757609e6ac70a1684cbf


Further Informations :

UPSMON detects a battery self-test as a calibration and records this
state with a flag.

However, it will never clear this flag.

During a power failure, when the battery charge level reaches "low
battery" state, the is_ups_critical function is called.

This detects the "on battery" and "low battery" states, but since the
"calibration" flag is not cleared, the function will block the rest of
the expected procedure. A log entry is created:
is_ups_critical: seems that UPS [Onduleur] is OB+LB now, but it is also
calibrating - not declaring a critical state

This behavior is easy to reproduce :

First test : (Shows that NUT is correctly configured)
- After starting the nut-monitor daemon, simulate a power failure
- The station is powered by the UPS battery
- Battery charge level becomes low
- UPSMON detects this and correctly shuts down the server

Second test : (Show the bug)
- After starting the nut-monitor daemon, simulate or wait for a battery
  self-test
- Wait for the test to be successful, so the station is powered by the
  mains
- Simulate a power failure
- The station is powered by the UPS battery
- Battery charge level becomes low
- UPSMON detects this but thinks the UPS is in calibration. A log
  entry is created, but the station will not be shut down

Third test : (Get around the problem)
- After starting the nut-monitor daemon, simulate or wait for a
  battery self-test.
- Wait for the test to be successful, so the station is powered
  by the mains.
- Restart the nut-monitor daemon (only this one)
- Simulate a power failure
- The station is powered by the UPS battery
- Battery charge level becomes low
- UPSMON detects this and correctly switches off the station


To solve the problem quickly:

Using the NUT v2.8.0 sources provided by Debian Bookworm
(apt source nut),
edit the file ./nut-2.8.0/clients/upsmon.c

Add this just after line 1678:
  if (!strstr(status, "CAL"))
        clearflag(&ups->status, ST_CAL);

see
https://github.com/networkupstools/nut/pull/2169/commits/b606d757660b85ba9123757609e6ac70a1684cbf

Thank you very much
Fabien



-- System Information:
Debian Release: 12.1
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 6.1.0-12-amd64 (SMP w/4 CPU threads; PREEMPT)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages nut-client depends on:
ii  adduser                    3.134
ii  init-system-helpers        1.65.2
ii  libc6                      2.36-9+deb12u3
ii  libupsclient6              2.8.0-7
ii  sysvinit-utils [lsb-base]  3.06-4

Versions of packages nut-client recommends:
ii  bash-completion  1:2.11-6

Versions of packages nut-client suggests:
pn  nut-monitor  <none>

-- Configuration Files:
/etc/nut/nut.conf changed [not included]
/etc/nut/upsmon.conf changed [not included]

-- no debconf information

--- End Message ---
--- Begin Message ---
Source: nut
Source-Version: 2.8.1-5+deb13u1
Done: Laurent Bigonville <[email protected]>

We believe that the bug you reported is fixed in the latest version of
nut, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Laurent Bigonville <[email protected]> (supplier of updated nut package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Wed, 16 Sep 2026 15:25:21 +0200
Source: nut
Architecture: source
Version: 2.8.1-5+deb13u1
Distribution: trixie
Urgency: medium
Maintainer: Laurent Bigonville <[email protected]>
Changed-By: Laurent Bigonville <[email protected]>
Closes: 1056190
Changes:
 nut (2.8.1-5+deb13u1) trixie; urgency=medium
 .
   * d/p/upsmon-clear-CAL-flag.patch: Clear the CAL flag in upsmon once
     the UPS has finished its calibration, otherwise a critical (OB+LB)
     state following a self-test is never acted upon and the shutdown is
     not triggered. (Closes: #1056190)
Checksums-Sha1:
 76c4d2cfae937be83cf2ddaa9c24274e7a82f7fe 3218 nut_2.8.1-5+deb13u1.dsc
 4e506d457863acc99e0fbb5dcc5930a1a1d505f9 73804 
nut_2.8.1-5+deb13u1.debian.tar.xz
 0a0022c180760e639efdefe9a924817b9beb6073 5973 
nut_2.8.1-5+deb13u1_source.buildinfo
Checksums-Sha256:
 db6ede74721f3a536bc759b47050cfa424d7c797eec3fb9a2afcbb6fa6e436e6 3218 
nut_2.8.1-5+deb13u1.dsc
 506804e1f74c5e75f786d9f2fdd82709e9042a5af39ec0c59b3fbfcc2865f065 73804 
nut_2.8.1-5+deb13u1.debian.tar.xz
 810a381483370894769cd2bb19276d43b4fcc060fcfccc25a1fbad68943bc12a 5973 
nut_2.8.1-5+deb13u1_source.buildinfo
Files:
 cb0494f84c4e4b86188aac5d1f910ef5 3218 admin optional nut_2.8.1-5+deb13u1.dsc
 5cc03f68f0767eb928844bc706b64c0b 73804 admin optional 
nut_2.8.1-5+deb13u1.debian.tar.xz
 8abda902a956cf93446517050d6137df 5973 admin optional 
nut_2.8.1-5+deb13u1_source.buildinfo

-----BEGIN PGP SIGNATURE-----

iQFFBAEBCgAvFiEEmRrdqQAhuF2x31DwH8WJHrqwQ9UFAmqqpdERHGJpZ29uQGRl
Ymlhbi5vcmcACgkQH8WJHrqwQ9WlMgf+M9ps+AjvMNk0K6n2i4Pcw5EyfgXdcD+3
nkv7iT140AAn1bM0cd+ywPf8qFaJunKokvxyXRcpcOBqbTnvfKqdEGvpl1GxxzlK
qXYvlg1O3kN/ddfPNSIvF3Lz+U9gbRiQaZM4u02SVOKzEDA4cYijUroAxDEPWAir
QhOqILEH+ez9zJJ5Y/cDTR1DIrwWon1Yp5IofCBSG89COkL5ffOQmxnBXo0q5ryX
uo08Fsmvz64WgwS+6BX/wuybHq+goKxwJiLgWkngQnNO7xNkLtrHL5ENz1LfgCwc
PWF8Pe2gmvsJGgxI7dT1jyNYBCWTRABO8VSsPEi2Vck6D9D1FFwnhg==
=O/Az
-----END PGP SIGNATURE-----

Attachment: pgpQCBJ2lohiG.pgp
Description: PGP signature


--- End Message ---

Reply via email to