I have a Bash script that requires some cleanup commands to happens when it gets closed in the console. Basically the cleanup is a restart command in my Python daemon program (let's call this P), which stops the current process and starts a new one. The Bash script is used to monitor the Python daemon app.However the problem is that for some reason, it's not launching the program to restart the Python program.Bash script is located on the desktop of my Raspberry Pi using Raspbian. I am supposed to start this by double-clicking it and selecting Execute in Terminal.Here is the gist of my code.function clean_up {    python3 A restart & #stops the python Deamon if running, then start it. (will start if it wasn't running to begin with)    disown    quit    }trap clean_up SIGINT trap clean_up SIGTERMtrap clean_up SIGHUPtrap clean_up SIGCHLDtrap clean_up SIGCONTpython3 A stop... (code to start monitor)python3 A start ArgumentToHookToMonistor 
Program is not launched in function that is called by a signal trap
bash;shell script;signals