system-helpers/usr/share/man/man1/systemd_failure_notify.1

75 lines
1.8 KiB
Groff
Raw Permalink Normal View History

.\" Automatically generated by Pandoc 3.0.1
.\"
.\" 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
systemd_failure_notify - Invokes when a systemd service has failed.
Configuration is done in environment files.
.PD 0
.P
.PD
It\[cq]s part of \f[B]system-helpers\f[R].
.SH SYNOPSIS
.PP
\f[B]systemd_failure_notify\f[R] [SERVICE]
.SH DESCRIPTION
.PP
\f[B]systemd_failure_notify\f[R] triggered when systemd services fail.
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
By default, \f[B]systemd_failure_notify\f[R] tries to read from
\f[I]$HOME/.systemd_failure_notify.conf\f[R] and
\f[I]/etc/systemd_failure_notify.conf\f[R] for configuration.
It will exit with a non-zero exit code if it cannot find a proper
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
Create a \f[I]$HOME/.systemd_failure_notify.conf\f[R].
Notifications will be delivered via \f[B]notifier\f[R].
Examples can be found in
\f[I]/usr/share/doc/system-helpers/systemd_failure_notify\f[R].
.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
.SH SEE ALSO
.PP
\f[B]notifier\f[R] - used as notification application
.SH AUTHORS
Alexander Schäferdiek.