I have a problem where on rare occasions my Type=simple systemd service hangs or gets caught in a loop. This causes its timer to stop scheduling the service because, as confirmed with sudo systemctl status myservice, the service is still running when it should have long exited. I haven't yet figured out the bug but it isn't critical. But in the mean time I don't want it to stop scheduling future runs.
Is there a way to specify in the systemd service file a maximum run time, after which it will force stop?
[Unit]
Description=scripts should run and exit but occasionally hangs or infinite loop
[Service]
SyslogIdentifier=myservice
Environment='MYVAR=myvar'
User=deanresin
Type=simple
ExecStart=/usr/bin/python3 /home/deanresin/myscript
oneshot, notsimpleTypesimpleandoneshoteven after reading the documentation.