Daemonizing a python programme.
Coy Krill
ckrill at qvlinc.com
Mon Mar 26 16:20:14 EST 2001
More information about the Python-list mailing list
Mon Mar 26 16:20:14 EST 2001
- Previous message (by thread): Some Basic Questions about Python
- Next message (by thread): Daemonizing a python programme.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
William Annis wrote: > Coy Krill <ckrill at qvlinc.com> writes: > > # get our own session and fixup std[in,out,err] > > os.setsid() > > I include these here: > > os.chdir(some_sensible_root_dir_for_core_files) > os.umask(000) # or whatever seems sensible > Thanks, I'll incorporate these ideas as well. > > sys.stdin.close() > > sys.stdout = NullDevice() > > sys.stderr = NullDevice() > > This is curious. Why not just close down STDOUT and STDERR, > too? The programmer is smart enough not to try to use any functions that read from stdin, however, he might import a module that tries to write to stdout or stderr which would cause the program to crash. This allows you to ignore any output with impunity. Coy
- Previous message (by thread): Some Basic Questions about Python
- Next message (by thread): Daemonizing a python programme.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list