Daemon and logging - the best approach?

Lech Karol Pawłaszek i at tak.znajdziesz
Fri Nov 7 16:43:04 EST 2008


Lawrence D'Oliveiro wrote:
> In message <gf1m17$qpc$1 at zeus.man.szczecin.pl>, Lech Karol Pawłaszek wrote:
> 
>> And now I want to read logging config file before daemonize the program
>> because the file might not be accessible after daemonization.
> 
> Why might it be inaccessible just because you've daemonized?

Well. Just because I always thought one should close all file
descriptors while daemonizing a process.

Just like here:
http://code.activestate.com/recipes/278731/

Lines 160-164.

If one would like to keep logging configuration in a file (like me),
what is supposed to do? Not to close FDs? Or just start logging after
daemonizing (and know absolute location of the logging configuration file)?

Or maybe is there any way to close FD for a logfile, daemonize and
reopen FD again?

;-) Am I clear now?

Kind regards,

-- 
Lech Karol Pawłaszek <ike>
"You will never see me fall from grace" [KoRn]



More information about the Python-list mailing list