How to stop systemd service exit code error status=2, while trying to start a python script based service in ubuntu OS?
I have created a script that monitors the time each application is running on my main window in Ubuntu OS and sends the data to a PostgreSQL db, The script is working fine but I need to manually start the script and need to keep it’s terminal open, and if my display is suspended or I have not closed my system completely the script keeps on recording the duration of application on window. After some searching I realized using systemd services I can ensure the script starts when my system starts and stops if the display is on sleep mode or suspended.