https://github.com/jgraichen/systemd-failure-notify
https://github.com/jgraichen/systemd-failure-notify
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/jgraichen/systemd-failure-notify
- Owner: jgraichen
- License: apache-2.0
- Created: 2022-04-20T10:54:10.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-05-01T18:53:02.000Z (about 2 years ago)
- Last Synced: 2025-03-29T05:12:31.626Z (about 1 year ago)
- Language: Shell
- Size: 11.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# systemd-failure-notify
Report service unit failures via email. The journal log from the failed
invocation will be included in the email body.
Can be easily added as `ExecStopPost` hook to existing units using the
provided drop-in snippet:
```ini
[Service]
ExecStopPost=+/usr/bin/systemd-failure-notify "%n"
```
If installed via package, a snippet is installed in
`usr/share/systemd-failure-notify`, that can be symlinked:
```sh
mkdir /etc/systemd/service/my.service.d
ln -s /usr/share/systemd-failure-notify/systemd-failure-notify.conf /etc/systemd/service/my.service.d/
```
`systemd-failure-notify` uses `/usr/bin/mail` to send notification
emails in case the [service result](https://www.freedesktop.org/software/systemd/man/systemd.exec.html#%24EXIT_CODE)
is not `success`. The package recommends `bsd-mailx | s-nail | mailutils`,
but only `bsd-mailx` has been tested so far.