On Ubuntu 18 I have a service :
[Unit]
Description=Gets CSV
OnFailure=pushovercsv.service
[Service]
ExecStart=/usr/bin/vehicles.sh
[Install]
WantedBy=multi-user.target
This works. I am trying unsuccessfully to setup another service which alerts me if the first service is stopped or in failed sate:
pushovercsv.service
[Unit]
Description=PushOver Notifaction for vehicles CSV Service
[Service]
Type=simple
ExecStart=curl -s --form-string "token=<secret>" --form-string "user=<secret>" --form-string "message=CSV service" https://<pushover api endpoint>
[Install]
WantedBy=multi-user.target
Both services work on there own.
But it doesn't appear as if OnFailure=pushovercsv.service
is calling the pushover service. If I stop the first service with systemctl stop service1
I get no alert from pushovercsv.service.
Does pushovercsv.service need to be manually started or is it started when called?