Good afternoon, I ran into a small problem.The purpose of this is in each of the necessary .service files for the OnFailure event to put the launch of a script that will send notification of the failure of a service through a telegram bot.But I ran into a problem, I can’t understand In the bash script, determine which service caused this script, so that you can indicate in the message from the bot that one or another service crashed.
cat/proc/$$/status | grep PPid | cut -f 2
get the pid of the parent process.
I don’t know about the unit yet.
And who prevents you from running the script in a unit and passing the necessary parameter to it?