On Sat, 1 Aug 2026 at 18:45, Felix E. Klee <[email protected]> wrote:

> 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.
>
> So I also use OnFailure= to send an email, however, in my opinion there is
limited value in getting an email for *each and every* service that fails.

Many services are dependent on each other, or could be made to be so via
their .service configuration.

e.g. on a database server you arm the database service, whereas on a lamp
server you could make php-fpm and apache dependent on each other and set an
on-failure only on php-fpm or apache but not both

(obviously there are downsides to making php dependent on apache, I know,
this is a contrived example)

my point is, not every service needs an on-failure alert email, and not
every service needs an OnFailure=restart

Others have pointed out that you could do monitoring using different
frameworks also, I believe what hasn't been mentioned is cockpit [1] which
can show you ongoing what the status is of your server. it may be more
useful than an endless parade of emails about restarting services

[1] https://wiki.archlinux.org/title/Cockpit

Reply via email to