Alternatively, if your shell script only does the preliminary work and nothing after the βrealβ command, you can replace the last line
exec python /usr/share/theapp/theapp.py
Which will replace the shell process with the python process, so that the latter will receive a signal directly and with the added benefit that you do not complete the inactivity process all the time.
Stefan friesel
source share