systemd-status-mail(8)
π systemd-status-mail(8) β the systemd-status-mail page, bestie edition π
okay so this is a page from the System Manager's Manual, and it's about systemd-status-mail β yes that's the real name, don't come for me, the description calls it systemd-mail-status and we're just gonna hold both of those facts at once like the icons we are π
β¨ NAME β¨
systemd-status-mail β sends you a mail when a systemd.timer fails. it's giving "your unit ghosted you but at least your inbox knows" π
πΈ SYNOPSIS πΈ
/usr/libexec/systemd-status-mail
/usr/lib/systemd/system/systemd-status-mail@.service
like, those two paths, that's the whole vibe.
π¦ DESCRIPTION π¦
so here's the tea π΅ β systemd-mail-status gets called by systemd-status-mail@.service when that service is wired up for the OnFailure and/or OnSuccess case of a systemd unit. (yes, OnSuccess too, it's not just a doom-and-gloom situation, we love range π)
and then it sends an email to an address you can configure, and that email contains:
- the name of the service
- the hostname
- the output of
systemctl status --full <service>
that's it, that's the whole personality, and honestly? iconic. π₯
π CONFIGURATION OPTIONS π
these are the variables, go off:
ADDRESS="root@localhost"β the address the status mail gets sent to. default is literally the machine talking to itself, no cap.FROM="root@myhostname"β the sender address of the status mail. who's it from? this. π«ΆHOSTNAME=""β the name of the host used as the domain for the from address (root@$HOSTNAME). it's lowkey the little nameplate on your envelope.MAILER="sendmail"β the name of the mail client that actually sends the status mail. valid values are"sendmail"and"mailx", and by default"sendmail"is used. pick your fighter βRELAYHOST=""β the mail relay used bymailx(1), but only if it's specified and not empty. no relay, no relaying, simple as that.MAILX_OPTIONS=""β extra options passed straight through tomailx(1). put your little extras here. π
π CONFIGURATION FILES π
/usr/etc/default/systemd-status-mailβ the vendor-provided config file. it contains the defaults, and you should probs not be messing with it fr fr./etc/default/systemd-status-mailβ the admin-provided config file. the rule here is that it should only contain the variables which were changed by the system administrator compared to the vendor configuration file. so, like, only your deltas. don't dump the whole thing in there π
π§ Example π§
okay so imagine os-update(8) fails (π) and you want to be informed. here's what you do: create a file called status-mail.conf in the /etc/systemd/system/os-update.service.d/ directory, and put this content in it:
[Unit]
OnFailure=systemd-status-mail@%n.service
and then β everytime os-update.service fails, a mail is send. yup. that's the whole trick. main character config file energy π
reminder bestie: keep that content verbatim, %n is doing real work in there and it's not a typo, don't touch it π
β SEE ALSO β
os-update(8), mailx(1), sendmail(1), postfix(1)
go read those too, iykyk π
π AUTHOR π
Thorsten Kukuk β the actual legend behind this page. we stan. π«Ά
and that's a wrap on the os-update manual, December 2024 edition, systemd-status-mail(8) β thank you for coming to my ted talk, now go configure your OnFailure, slay, periodt π
β¨πΈ
π¦ where this page comes from
- opensuse-leap 16.0: systemd-status-mail 1.21+git.20241206-160000.2.2 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms