in reply to Win32::Daemon service doesn't reach RUNNING state

Hi,

I have the same symptoms as above.

I have a full-fledged service based on Win32::Daemon.

It is working correctly on at least 5 computers.

On the remaining computers, the section in the if statement shown below never executes.

I have modeled after example 5 on https://metacpan.org/pod/Win32%3A%3ADaemon

sub Callback_Running { my($Event, $Context) = @_; print "State: " . Win32::Daemon::State() . "\n"; if(SERVICE_RUNNING == Win32::Daemon::State()) { Log 1, "DBSAgent is checking in.";;

On the server I can troubleshoot on, State displayed as 1: SERVICE_STOPPED on the first call, then 0: SERVICE_NOT_READY on each call after that. It never displayed as 4: SERVICE_RUNNING like it was supposed to.

The server I am troubleshooting on is Windows Server 2012 R2 Standard 64-bit v6.3.9600

Help is greatly appreciated! Thanks :-)

Replies are listed 'Best First'.
Re^2: Win32::Daemon service doesn't reach RUNNING state
by haukex (Archbishop) on May 23, 2019 at 18:57 UTC

    Note that the thread you're replying to is 15 years old. I would recommend starting a new thread, and including a minimal but runnable SSCCE that reproduces the issue on your end.