I'd redirect STDERR to a file (and probably do that in a BEGIN block near the top of the main script file). When Perl dies, it almost always says something on the way down. I suspect Win32 is just throwing this information away.
Using threads in Perl sounds like a recipe for having things die rather mysterious to me. So I'm not surprised you've experienced this.
You might want to write a manager that gets run as a service and have it launch and re-launch the script that does the real work. It is also a good idea to have long-running processes restart themselves periodically. If you write the manager, then you could just have the worker script exit when idle if its been running longer than X. Getting the manager restarted periodically is trickier. On Unix, I'd just occasionally do exec($^X,$0,@ARGV), but I recall exec being more like system+exit in Win32 (despite MicroSoft claiming "the new process is placed in the memory previously occupied by the calling process") and that might not play well with the Service Control Manager or other bits.
- tye
In reply to Re: Debugging Windows Services created with Win32::Daemon (STDERR)
by tye
in thread Debugging Windows Services created with Win32::Daemon
by hackdaddy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |