How to set autostart and Autorestart script?

Good time of day.

There is a script that works with selenium. You need to configure it to autostart and restart in the fall.
Tried to do through the supervisor and systemd, but the driver does not open a browser window while the process runs.

How can this be solved?
June 10th 19 at 15:52
2 answers
June 10th 19 at 15:54
Without the code of the script will be a lot of "if...".
The algorithm is roughly like this:
1. The script launches something.
2. This is something has its own PID.
3. The script gets this PID.
4. Further, for example, the loop "while ... do" sleep with om. There are PID - skip, no PID-a - restartuem.
And the new... in a loop.
June 10th 19 at 15:56

Find more questions by tags SupervisorLinux