Scope: restart a process if it exited for any reason
To do: edit "process-restart.sh" substituting "process" with the actual process name and startup command/path. Moreover you'd want to rename both file with the process name. To find what the actual process name is, do a ps aux | grep <name>
and then test with pgrep -f <process_you_found>
- see if it returns the correct PID.
Usage: run ./process-loop.sh
TIP: always use TMUX or screen.
I'm using this method to keep my bots¹ and the ETS2 server always running:
¹ BOTS == ZED, a couple XMPP bots, Simplebot Mastodon etc..