System is Debian Whezy x64. I currently use screen to start programs as user rather than root. It looks like this: In /etc/rc.local, I call
su -c "/home/user/scripts/startup" user
Then, in /home/user/scripts/startup, I call a few python programs like this:
screen -dmS my_program python /home/user/my_program.py
They all start fine. The problem is that these programs tend to update themselves every week or so. When the program updates, it tries to restart itself. Upon the program's restart, the screen session terminates, and the program does not start again. So, after a few days, I notice the program isn't working and need to start it again by hand.
Is there something I can do to ensure that the program will start itself again after a program restart?
Edit: I've read something about screen's "zombie mode" that allows it to stay active, but I don't know how to invoke it at boot.