You are not logged in.
Pages: 1
I have a systemd user service to notify me anytime a service fails:
[Unit]
Description=Send notifications when other services fail
[Service]
Type=simple
ExecStart=notify-send -u normal "%I failed"
I apply it in service.d/10-all.conf:
[Unit]
OnFailure=notify-failed@%n
However, I have one service for which I would like this to not apply (because it fails a lot and there seems to be nothing I can do about it, so I just want it to quietly restart). I've tried creating an override just for that service, but it seems you can't clear OnFailure. Is there a way to apply my override for every service except one?
Last edited by omar123 (2025-06-12 13:54:24)
Offline
it seems you can't clear OnFailure
idk whether that's the case, but you could discriminate the services in the failure script (ie. run some bash script instead of notify-send and there test $1)
Offline
As I wrote the post I rubber ducked myself into realizing I could just filter the notification in dunst, which I guess is as good a solution as any.
I then tried looking into why OnFailure can't be cleared (I remember reading about this a while ago while trying to fix this), but instead found out about RestartMode=direct which lets you skip OnFailure. This is clean enough for me, so I'll consider this solved.
Offline
Pages: 1