For the past week, I been having a bug that my python code hasn't been doing a cleanup process properly. It was suppose to once it captures a signal caused by closing the terminal, it does some cleanup actions but in the end, it never did that.
Just a few moments ago I figured out why, since my python code required root privileges (A few commands it calls requires such privileges) to run, and because of my terminal was a user terminal, my signal was block and never went through.
So preferably using some sort of bash script or something, how do I escalate a signal so that my python code can capture it. On my debian system, calling sudo for anything doesn't cause a password prompt.