Skip to content

Commit 12f76f6

Browse files
committed
common/common.c: upsnotify(): make first/only notification faults visible
They can be important for troubleshooting, e.g. services that rely on sd_notify() but never get the READY message would loop in restarts. Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
1 parent 2918f0a commit 12f76f6

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

common/common.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -832,14 +832,14 @@ int upsnotify(upsnotify_state_t state, const char *fmt, ...)
832832
NUT_UNUSED_VARIABLE(buf);
833833
NUT_UNUSED_VARIABLE(msglen);
834834
if (!upsnotify_reported_disabled_systemd)
835-
upsdebugx(6, "%s: notify about state %i with libsystemd: "
835+
upsdebugx(0, "%s: notify about state %i with libsystemd: "
836836
"skipped for libcommonclient build, "
837837
"will not spam more about it", __func__, state);
838838
upsnotify_reported_disabled_systemd = 1;
839839
# else
840840
if (!getenv("NOTIFY_SOCKET")) {
841841
if (!upsnotify_reported_disabled_systemd)
842-
upsdebugx(6, "%s: notify about state %i with libsystemd: "
842+
upsdebugx(0, "%s: notify about state %i with libsystemd: "
843843
"was requested, but not running as a service unit now, "
844844
"will not spam more about it",
845845
__func__, state);
@@ -1110,7 +1110,7 @@ int upsnotify(upsnotify_state_t state, const char *fmt, ...)
11101110
) {
11111111
if (ret == -127) {
11121112
if (!upsnotify_reported_disabled_notech)
1113-
upsdebugx(6, "%s: failed to notify about state %i: no notification tech defined, will not spam more about it", __func__, state);
1113+
upsdebugx(0, "%s: failed to notify about state %i: no notification tech defined, will not spam more about it", __func__, state);
11141114
upsnotify_reported_disabled_notech = 1;
11151115
} else {
11161116
upsdebugx(6, "%s: failed to notify about state %i", __func__, state);
@@ -1120,7 +1120,7 @@ int upsnotify(upsnotify_state_t state, const char *fmt, ...)
11201120
#if defined(WITH_LIBSYSTEMD) && (WITH_LIBSYSTEMD)
11211121
# if ! DEBUG_SYSTEMD_WATCHDOG
11221122
if (state == NOTIFY_STATE_WATCHDOG && !upsnotify_reported_watchdog_systemd) {
1123-
upsdebugx(6, "%s: logged the systemd watchdog situation once, will not spam more about it", __func__);
1123+
upsdebugx(0, "%s: logged the systemd watchdog situation once, will not spam more about it", __func__);
11241124
upsnotify_reported_watchdog_systemd = 1;
11251125
}
11261126
# endif

0 commit comments

Comments
 (0)