Using a toplevel override, I set up email notification on service fail:

    # /etc/systemd/system/service.d/toplevel-override.conf
    [Unit]
    OnFailure=failure-notification@%n

Now, every time a service fails to start, I get an email, on every
single restart attempt. This can result in many emails. In fact, if
`StartLimitBurst` is not set, I would get mailbombed by my server.

Therefore, I am thinking about a different solution that does not have
the mailbomb risk: A timer that sends an email if there is a failed
service. Having the timer trigger every hour would be sufficient. It
certainly would be better than getting no notification at all.

*Am I reinventing the wheel? Isn’t there already something that solves
the problem?*

Reply via email to