def main():
    """ A demo daemon main routine, write a datestamp to 
        /tmp/daemon-log every 10 seconds.
    """
    import time

    f = open("/tmp/daemon-log", "w") 
    while 1: 
        f.write('%s\n' % time.ctime(time.time())) 
        f.flush() 
        time.sleep(10)
 A demo daemon main routine, write a datestamp to 
        /tmp/daemon-log every 10 seconds.
    
recipes/Python/66012_Fork_a_daemon_process_on_Unix/recipe-66012.py