2023-03-21 17:48:46 +00:00
|
|
|
.\" Automatically generated by Pandoc 3.0.1
|
2023-01-25 01:16:01 +00:00
|
|
|
.\"
|
|
|
|
.\" Define V font for inline verbatim, using C font in formats
|
|
|
|
.\" that render this, and otherwise B font.
|
|
|
|
.ie "\f[CB]x\f[]"x" \{\
|
|
|
|
. ftr V B
|
|
|
|
. ftr VI BI
|
|
|
|
. ftr VB B
|
|
|
|
. ftr VBI BI
|
|
|
|
.\}
|
|
|
|
.el \{\
|
|
|
|
. ftr V CR
|
|
|
|
. ftr VI CI
|
|
|
|
. ftr VB CB
|
|
|
|
. ftr VBI CBI
|
|
|
|
.\}
|
|
|
|
.TH "systemd_failure_notify" "1" "January 2023" "systemd_failure_notify" ""
|
|
|
|
.hy
|
|
|
|
.SH NAME
|
|
|
|
.PP
|
2023-01-25 23:21:49 +00:00
|
|
|
systemd_failure_notify - Invokes when a systemd service has failed.
|
2023-01-25 01:16:01 +00:00
|
|
|
Configuration is done in environment files.
|
|
|
|
.PD 0
|
|
|
|
.P
|
|
|
|
.PD
|
|
|
|
It\[cq]s part of \f[B]system-helpers\f[R].
|
|
|
|
.SH SYNOPSIS
|
|
|
|
.PP
|
2023-01-25 22:27:38 +00:00
|
|
|
\f[B]systemd_failure_notify\f[R] [SERVICE]
|
2023-01-25 01:16:01 +00:00
|
|
|
.SH DESCRIPTION
|
|
|
|
.PP
|
2023-01-25 23:21:49 +00:00
|
|
|
\f[B]systemd_failure_notify\f[R] triggered when systemd services fail.
|
2023-01-25 01:16:01 +00:00
|
|
|
It comes with systemd services.
|
|
|
|
Use the provided systemd service in the \f[B]OnFailure\f[R] directive
|
|
|
|
with \f[I]OnFailure=systemd_failure_notify\[at]%n.service\f[R].
|
|
|
|
.PP
|
2023-01-25 22:27:38 +00:00
|
|
|
By default, \f[B]systemd_failure_notify\f[R] tries to read from
|
2023-01-25 01:16:01 +00:00
|
|
|
\f[I]$HOME/.systemd_failure_notify.conf\f[R] and
|
|
|
|
\f[I]/etc/systemd_failure_notify.conf\f[R] for configuration.
|
2023-01-25 22:27:38 +00:00
|
|
|
It will exit with a non-zero exit code if it cannot find a proper
|
2023-01-25 01:16:01 +00:00
|
|
|
configuration file.
|
|
|
|
.PP
|
|
|
|
You can copy this script to \f[I]/usr/local/bin\f[R] and use create a
|
|
|
|
custom \f[B]CONFIG_FILE\f[R] as user.
|
|
|
|
.SH EXAMPLE
|
|
|
|
.PP
|
2023-01-25 23:21:49 +00:00
|
|
|
Create a \f[I]$HOME/.systemd_failure_notify.conf\f[R].
|
|
|
|
Notifications will be delivered via \f[B]notifier\f[R].
|
2023-01-25 01:16:01 +00:00
|
|
|
Examples can be found in
|
2023-01-26 23:53:23 +00:00
|
|
|
\f[I]/usr/share/doc/system-helpers/systemd_failure_notify\f[R].
|
2023-01-25 01:16:01 +00:00
|
|
|
.PP
|
|
|
|
Then, add \f[B]systemd_failure_notify\[at]serviceName\f[R] in a systemd
|
|
|
|
unit file in the \f[B]OnFailure\f[R] directive:
|
|
|
|
.PP
|
|
|
|
[Unit]
|
|
|
|
.PD 0
|
|
|
|
.P
|
|
|
|
.PD
|
|
|
|
OnFailure=systemd_failure_notify\[at]%n.service
|
|
|
|
.PD 0
|
|
|
|
.P
|
|
|
|
.PD
|
|
|
|
.SH EXIT VALUES
|
|
|
|
.TP
|
|
|
|
\f[B]0\f[R]
|
|
|
|
Success
|
|
|
|
.TP
|
|
|
|
\f[B]1\f[R]
|
|
|
|
Error
|
2023-01-25 23:21:49 +00:00
|
|
|
.SH SEE ALSO
|
|
|
|
.PP
|
|
|
|
\f[B]notifier\f[R] - used as notification application
|
2023-01-25 01:16:01 +00:00
|
|
|
.SH AUTHORS
|
2023-03-21 17:48:46 +00:00
|
|
|
Alexander Schäferdiek.
|