Skip to content

Commit

Permalink
refactor: harmonize email-failures service
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgarel authored and root committed Jan 31, 2024
1 parent 6b196d2 commit c4f0659
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
4 changes: 2 additions & 2 deletions confs/common/systemd/system/[email protected]
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[Unit]
# call this unit in the OnFailure directive
# you can use %i if needed, or %l (%H on older systemd versions)
Description=%i failure email notification
Description=%i failure email notification on %l

[Service]
Type=oneshot
# replace __ by @ in instance name to be able to call status on a specific instance
# then use mailx to email status (apt install bsd-mailx if needed)
ExecStart=/bin/bash -c 'HOST_NAME=%H;INSTANCE_NAME=%i; SERVICE_NAME=$${INSTANCE_NAME//__/@}; /bin/systemctl status $$SERVICE_NAME | /usr/bin/mailx -s "[$$HOST_NAME][$$SERVICE_NAME] failure notification" root'
ExecStart=/bin/bash -c 'HOST_NAME=%H; INSTANCE_NAME=%i; SERVICE_NAME=$${INSTANCE_NAME//__/@}; /bin/systemctl status $$SERVICE_NAME | /usr/bin/mailx -s "[$$HOST_NAME][$$SERVICE_NAME] failure notification" root'

9 changes: 0 additions & 9 deletions confs/off2-reverse-proxy/systemd/system/[email protected]

This file was deleted.

1 change: 1 addition & 0 deletions confs/off2-reverse-proxy/systemd/system/[email protected]

0 comments on commit c4f0659

Please sign in to comment.