[Tutor] how to run a process forever

Steve Willoughby steve at alchemy.com
Wed Dec 10 19:28:37 CET 2008


On Wed, Dec 10, 2008 at 12:23:48PM -0600, shawn bright wrote:
> Hey gents,
> 
> I have an interesting problem. I need to have a python script start
> when a computer boots up, and i need it to run forever.
> I also am going to run a script by cron that will check to see if the
> process is running, if not, i need a python script to execute
> the script.

Maybe I'm misunderstanding your meaning, but usually programs which do
this don't do anything unusual other than... well... simply run forever
in the background (launched from the startup scripts or cron, disassociated
from any TTY, of course).  A watchdog re-launcher cron script is also
not uncommon.

If your script isn't actively doing something it's good to put it to
sleep until some interesting event (or timer) wakes it up.

Was there something beyond that you were looking for?

-- 
Steve Willoughby    |  Using billion-dollar satellites
steve at alchemy.com   |  to hunt for Tupperware.


More information about the Tutor mailing list