Try another method for crash mailing

This commit is contained in:
Asaf Gartner 2021-09-04 21:48:47 +03:00
parent 39efde5369
commit 67ff97b27d
4 changed files with 7 additions and 3 deletions

View File

@ -1,5 +1,9 @@
#!/bin/bash
if [ $SERVICE_RESULT == "success" ]; then
exit
fi
/home/hmn/hmn/adminmailer/adminmailer "[$1] Status changed" <<ERRMAIL
$(service "$1" status)
ERRMAIL

View File

@ -28,7 +28,7 @@ LimitNPROC=512
PrivateTmp=true
ProtectSystem=full
AmbientCapabilities=CAP_NET_BIND_SERVICE
OnFailure=status-email@%n.service
ExecStopPost=status-email@%n.service
[Install]
WantedBy=multi-user.target

View File

@ -10,7 +10,7 @@ ExecStart=/home/hmn/hmn/cinera/start.sh
ExecStop=/home/hmn/hmn/cinera/stop.sh
PIDFile=/home/hmn/hmn/cinera/data/cinera.pid
Restart=always
OnFailure=status-email@%n.service
ExecStopPost=status-email@%n.service
[Install]
WantedBy=multi-user.target

View File

@ -8,7 +8,7 @@ Group=hmn
ExecStart=/home/hmn/bin/hmn
Restart=always
TimeoutStopSec=15
OnFailure=status-email@%n.service
ExecStopPost=status-email@%n.service
[Install]
WantedBy=multi-user.target