[Chicago-talk] writing a log with Cron, Daemons, Perl
Paul Baker
pbaker at where2getit.com
Tue Sep 9 12:23:08 CDT 2003
On Monday, September 8, 2003, at 10:41 PM, Jay Strauss wrote:
>> Having said that though, why are you trying to send something to
>> STDOUT? Daemon's aren't supposed to do that, that's why they close
>> them. And you are already writting your debugging to a log via STDERR,
>> so what do you need STDOUT for?
>
> I thought I'd print the startup messages to the screen and then
> redirect the
> runtime messages to a file
Ah, well in that case, all your startup messages should occur before
you daemonize. Meaning, any start up initialization stuff should occur
before you go into the daemon (and any output should probably go to the
REAL STDERR and not STDOUT). Then once you have done all your init, the
last step before you start your process loop would be to then of course
daemonize and then reopen STDERR to the logfile.
--
Paul Baker
"Yes, we did produce a near-perfect republic. But will they keep it? Or
will they, in the enjoyment of plenty, lose the memory of freedom?”
-- Thomas Jefferson in a letter to John Adams
GPG Key: http://homepage.mac.com/pauljbaker/public.asc
More information about the Chicago-talk
mailing list