Waybar icon indicating copy to clipboard operation
Waybar copied to clipboard

systemd-failed-units doesn't update

Open elliott-farrall opened this issue 1 year ago • 3 comments
trafficstars

I've been having issues with the systemd-failed-units module not updating. If I login with a failed unit then it will successfully report that failed unit. However, if I then restart that unit and it is no longer failing, the waybar module will not reflect this change until I next login (or restart waybar).

I'm not too familiar with the way the modules are implemented but I noticed that in the src for systemd-failed-units it doesn't implement the interval option. I have tried setting both interval and restart-interval and neither has made a difference. Based on this I assume that the module is supposed to continuously check the units without exiting.

Has anyone else had this issue? I have installed waybar via nixpkgs (unstable).

elliott-farrall avatar Jul 16 '24 12:07 elliott-farrall

Just tried it out and fixed a system error, the module was updated right away. It does so by handling DBus signals. No intervals needed. The module hasn't really changed since its inception. Theoretically nixpgks could have patched it, but I doubt it. So I'm probably using the same code.

The best idea I can offer for troubleshooting is to look at Waybar's output, see if there are any error messages.

RobertMueller2 avatar Jul 20 '24 10:07 RobertMueller2

Sorry for the delayed response, just had another go at setting this up and still can't get the module to reflect any changes in the failed units without restarting waybar.

I suspect the issue is with the way waybar is packaged in nixpkgs so I will look into raising an issue there. I couldn't see anything to do with systemd in the output for waybar. I'm far from an expert when it comes to DBus signals; do you have any suggestions of where to look to see if waybar is actually getting these signals? I checked dbus.service at both system and user level and couldn't see anything related to waybar.

elliott-farrall avatar Sep 24 '24 10:09 elliott-farrall

After further experimentation I have found that this issue only occurs for user units.

elliott-farrall avatar Oct 02 '24 08:10 elliott-farrall

i can confirm that waybar doesn't notice resolution on failed user units.

anarcat avatar Jan 07 '25 03:01 anarcat

That explains it, I'd only tested it with system units. I can see that no signal is triggered. This can be observed with a debugger, but also dbus-monitor for session vs. system. And also when connecting to the PropertyChanged signals of systemd1 using QT's qdbusviewer. There's just nothing at all on the user side.

Interestingly, when there's a system update, the user portion is updated properly and this can be observed in dbus-monitor as well.

I don't see any obvious bug in the code. I'm not sure if this is a DBus issue, or if anything else is needed to add signal handling for session DBus. Maybe it's related to how the session is started -- but I'm not seeing any error messages anywhere and don't experience other DBus related issues, or at least as far as I'm aware of :p

I'm out of ideas for now.

RobertMueller2 avatar Mar 10 '25 18:03 RobertMueller2