Currently, there's a fairly complex Python script that manages several dozen processes across a few servers. Each individual process has the same setup/requirements:
- Main process must come up and be monitored
- Helper network process must come up and be monitored
- If helper crashes, restart it
- User must be able to issue a command that closes main and helper process, zips up log files, and cleans up after itself.
- If main process dies, cores will likely have been generated, so zip up logs and cores as well as killing off the helper process
Right now, logs (stdout from the main process) and cores are written to /var/log/so-and-so/ which is a tmpfs partition to speed things up. Otherwise, the Python script drops PID files into /run/so-and-so/ to keep track of who's doing what.
The time has come where my users would like these processes to start themselves daily. Presumably, they'll want to have them die at certain times as well, but that's yet to requested.
I've never done anything more than fire up one single script with systemd, so I'm not sure how to make things interdependent, or if this task is an appropriate systemd project in the first place. So that's my question(s). Is this something systemd should be doing? And if so, what should it look like?