I have a raspberry pi on which I'm running some services. I need to be able to ssh into the machine and monitor those services. Currently, what I do is I log in, run
screen, then create three windows and in each window run the script that runs the relevant service. Two of these are actually running as root (one monitors the network, another monitors some hardware connected to the pi). The third is running the actual service, and runs in my user. (The second is basically a proxy for the hardware to talk to the third.)
In any case, this works great, except that when the pi gets rebooted for whatever reason (e.g. power failure), I have to set all this up again, which is tedious.
What I would like is for the system to run
screen in my user or startup automatically, with three windows created, two running processes as root and one in my user, such that when I log in, I can connect to that screen session and see everything running live.
How would I do that?