in reply to Re^4: Debugging Windows Services created with Win32::Daemon (STDERR)
in thread Debugging Windows Services created with Win32::Daemon

Thank you.

I suspect that won't catch output to STDERR nor non-zero exit status, but I have no proof [and so this node is mostly useless (except for the 'thank you') unless it prompts someone to discover such answers :) ]

- tye        

  • Comment on Re^5: Debugging Windows Services created with Win32::Daemon (STDERR)

Replies are listed 'Best First'.
Re^6: Debugging Windows Services created with Win32::Daemon (STDERR)
by BrowserUk (Patriarch) on Nov 17, 2005 at 04:58 UTC
    I suspect that won't catch output to STDERR nor non-zero exit status.

    You are correct, my memory was fuzzy. In order for the exit status of the service to raise an event message log, the service has to

    If a service calls SetServiceStatus with the dwCurrentState member set to SERVICE_STOPPED and the dwWin32ExitCode member set to a nonzero value, the following entry is written into the System event log:

    Event ID = 7023 Source = Service Control Manager Type = Error Description = <ServiceName> terminated with the following error: <ExitCode>.

    This is available via the Win32::Deamon function

    State( { state => SERVICE_STOPPED, waithint => 0, error => $exit_code +} );

    STDERR will only log to the eventlog if the programmer arranges for it to do so through a tied filehandle or signal handlers. Which would work for program generated errors, but probably not those coming from withn the Perl executable like panics.

    Though, if enabled, segfaults will be logged.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.