in reply to Win32::Daemon installed service fails to start

I haven't written a service in a while (and when I did it was in C...) One thought I had is that your open might not be in a good place. I would do the open in the SERVICE_RUNNING state and close it after doMyStuff. ALSO, you might check to make sure your prints aren't being buffered, so put $|++; at the top.

Also, code running as a service doesn't have access to drive mappings that you do. If you are trying to write to anything other than the local machine, then you will have to run the server as a user.


"Look, Shiny Things!" is not a better business strategy than compatibility and reuse.


OSUnderdog

Replies are listed 'Best First'.
Re^2: Win32::Daemon installed service fails to start
by punkish (Priest) on Dec 28, 2004 at 04:31 UTC
    No, it has nothing to do with open or print. I actually pared down the script to the barest minimum possible (pseudo code follows)
    start service sleep for 30 stop service
    The darn service just doesn't start. Google revealed a thread on ASPN's forum -- someone there was having a similar, inexplicable problem with a WinXP machine, while the exact same script was running fine on a Win2k box. Others reported back that they had no problems on WinXP. I am wondering if I have been hit by some strange WinXP related bug. Tomorrow I will see if I can try the script on a Win2k box.

    Very frustrating.