On Sun, 30 Nov 2025, Jim Klimov wrote:
> Maybe then use double-quotes around the command, and escape the inner ones
> for
> grep args. Or make a wrapper script in a separate file with equivalent
> content, and call it as ExecStart.
I created a separate file /usr/local/bin/nut-monitor.ExecStart.sh
#! /bin/bash -u
# The following filter prevents upsmon from flooding the journal with
# banner messages every 300 sec when upssched restarts the heartbeat.
/usr/sbin/upsmon -F | grep -vE "Network UPS Tools upsmon 2\.8\.[012]"
In /usr/lib/systemd/system/nut-monitor.service I set
ExecStart=/usr/local/bin/nut-monitor.ExecStart.sh
I ran
systemctl daemon-reload
systemctl restart nut-monitor
systemctl status nut monitor
and saw
CGroup: /system.slice/nut-monitor.service
├─10435 /bin/bash -u /usr/local/bin/nut-monitor.ExecStart.sh
├─10438 /lib/nut/upsmon -F
├─10439 grep -vE "Network UPS Tools upsmon 2\\.8\\.[012]"
├─10440 /lib/nut/upsmon -F
└─10444 /usr/sbin/upssched "UPS heartbeat@localhost: On battery"
There is no more flooding with banners.
I guess that I am one of the very few users of a heartbeat UPS, so this local
fix is good enough.
Roger_______________________________________________
Nut-upsuser mailing list
[email protected]
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser