Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Win32::Daemon service doesn't reach RUNNING state

by footpad (Abbot)
on May 28, 2019 at 16:50 UTC ( #11100651=note: print w/replies, xml ) Need Help??


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

I don't have a setup where I can easily try to reproduce your results, however, I notice that you don't do much with the return value of CreateService(). Per the module docs, you should be calling GetLastError() when CreateService() returns false. The underlying service docs go into a bit more detail about the data that might be returned. (You'll likely need to dig up the underlying constant values.)

I'd start by trying to get more extended error info. That should lead you to the next step in your investigation.

(One obvious question is "Are you running this as an admin?" The note on the CPAN doc (see link above) suggests that's a requirement.)

Hope this helps...

--f

  • Comment on Re: Win32::Daemon service doesn't reach RUNNING state

Replies are listed 'Best First'.
Re^2: Win32::Daemon service doesn't reach RUNNING state
by SwaJime (Scribe) on May 28, 2019 at 17:00 UTC

    Thank, I will look into this. Meanwhile, I found more info: Changing Callback_Start as follows allows it to run, however the resume/contine callback function does not work and does not benefit from a similar change:

    sub Callback_Start { my($Event, $Context) = @_; print $fh "Starting\n"; print $fh "DEBUG Setting Context\n"; $Context->{last_state} = SERVICE_RUNNING; print $fh "DEBUG Setting State\n"; Win32::Daemon::State( SERVICE_RUNNING ); print $fh "DEBUG Setting State again\n"; Win32::Daemon::State( SERVICE_RUNNING ); }

      The error message you mentioned was not triggered in my case. Thanks for the detail, and I will add that to my code. But that is not the issue directly at hand.

Re^2: Win32::Daemon service doesn't reach RUNNING state
by SwaJime (Scribe) on May 28, 2019 at 17:03 UTC

    Also, yes, I am running as admin.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11100651]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2021-04-12 07:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?