Skip to content
Snippets Groups Projects
Commit 8422abf7 authored by ju xor's avatar ju xor
Browse files

wip: Add examples for mail on unit failure

Is this a suitable place to put them?

Closes https://gitlab.torproject.org/tpo/network-health/sbws/-/issues/40178
parent 677a9008
No related branches found
No related tags found
No related merge requests found
OnFailure=status-email-user@%n.service
\ No newline at end of file
#!/bin/bash
/usr/sbin/sendmail -t <<ERRMAIL
To: $1
From: systemd <root@$HOSTNAME>
Subject: $2
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=UTF-8
$(systemctl status --full "$2")
ERRMAIL
\ No newline at end of file
[Unit]
Description=status email for %i to user
[Service]
Type=oneshot
ExecStart=/usr/bin/status_mail.sh sbws@localhost %i
User=nobody
Group=systemd-journal
debian/examples/*
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment