in reply to Re^2: Debugging Windows Services created with Win32::Daemon (STDERR)
in thread Debugging Windows Services created with Win32::Daemon
Using Win32::EventLog in conjunction with a __DIE__ handler would perhaps be a better solution.
If you define "better" as "still throws away lots of possible sources of information". Eventually, I'd do both. As a first step in figuring out what is going wrong, I'd go with the much simpler approach that catches stuff other than just die cases. To illustrate just one case: I wouldn't be at all surprised if Perl, after reporting "panic: ...", might not survive long enough to make it all the way to the end of the non-trivial number of opcodes required to catch then get stuff into the event log.
Wouldn't a pucker *nix daemon also throw away any parting STDERR output? The done thing is to close all the standard filestreams isn't it?
A production-quality daemon usually redirects STDERR to /dev/null (closing is a bad idea). But a Unix daemon who doesn't do this could end up with its output automatically going to the system log (or, on some older Unixes, to "the console"). On some old Unix configurations, this could actually cause problems. My comment wasn't meant to be a dig against Win32. I still suspect that Win32 is just throwing away the information. And sometimes that has its advantages. No need to get defensive. (:
It's quite likely that (if enabled) any non-zero termination code or STDERR output would end up in the system or application portion of the event log
What does "if enabled" mean? If there is a Win32 option to redirect daemon output to the event log, then hackdaddy would probably appreciate a pointer to it. He reports that such isn't happening for him.
- tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Debugging Windows Services created with Win32::Daemon (STDERR)
by BrowserUk (Patriarch) on Nov 16, 2005 at 21:07 UTC | |
by tye (Sage) on Nov 17, 2005 at 00:33 UTC | |
by BrowserUk (Patriarch) on Nov 17, 2005 at 04:58 UTC |