I have a service of type 'notify' that uses a watchdog script. The service restarts automatically (restart=always).
I want to run a (bash) script whenever the service restarts due to a crash or due to a watchdog trigger. The custom script should not be ran when the service is stopped/started through systemd (using eg. systemctl).
The 'OnFailure' hook is not working because the service is restarting automatically and thus never reaches a failed state.