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 #!/bin/bash
if [ $SERVICE_RESULT == "success" ]; then
exit
fi
/home/hmn/hmn/adminmailer/adminmailer "[$1] Status changed" <<ERRMAIL /home/hmn/hmn/adminmailer/adminmailer "[$1] Status changed" <<ERRMAIL
$(service "$1" status) $(service "$1" status)
ERRMAIL ERRMAIL

View File

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

View File

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

View File

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