Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Win32::Daemon on Windows 2019 has options greyed out

by SwaJime (Scribe)
on Oct 03, 2019 at 15:06 UTC ( #11107011=perlquestion: print w/replies, xml ) Need Help??

SwaJime has asked for the wisdom of the Perl Monks concerning the following question:

Followup on Win32::Daemon service doesn't reach RUNNING state

Rg: Win32::Daemon on Windows 2019 via Strawberry Perl

I've found that on Windows 2019, I cannot pause or restart the service via services.msc.

If anybody knows what I need to do to fix that, please please let me know.

Thanks :-)

  • Comment on Win32::Daemon on Windows 2019 has options greyed out

Replies are listed 'Best First'.
Re: Win32::Daemon on Windows 2019 has options greyed out
by Anonymous Monk on Oct 04, 2019 at 00:36 UTC
    What about using "net stop" and "net start"?

      Only net start works:

      C:\windows\system32>taskkill /FI "SERVICES eq MyCustomService" /F SUCCESS: The process with PID 3816 has been terminated. C:\windows\system32>net start MyCustomService The DBSmart Agent (MyCustomService) service is starting. The DBSmart Agent (MyCustomService) service was started successfully. C:\windows\system32>net pause MyCustomService The requested pause, continue, or stop is not valid for this service. More help is available by typing NET HELPMSG 2191. C:\windows\system32>net stop MyCustomService The requested pause, continue, or stop is not valid for this service. More help is available by typing NET HELPMSG 2191. C:\windows\system32>net start MyCustomService The requested service has already been started. More help is available by typing NET HELPMSG 2182.
      Thanks
Re: Win32::Daemon on Windows 2019 has options greyed out
by Anonymous Monk on Oct 08, 2019 at 00:43 UTC

      Thanks,

      I tried the test at that link and get the same results:

      C:\Users\john\test>perl Create.pl Successfully added. finished. C:\Users\john\test>net start perltest The Perl: Test of Win32::Daemon ($ServiceName) service is starting. The Perl: Test of Win32::Daemon ($ServiceName) service was started suc +cessfully. C:\Users\john\test>net pause perltest The requested pause, continue, or stop is not valid for this service. More help is available by typing NET HELPMSG 2191. C:\Users\john\test>net stop perltest The requested pause, continue, or stop is not valid for this service. More help is available by typing NET HELPMSG 2191.

      All of the menu options are greyed out for starting, stopping, etc. for the PerlTest service, just as they are for my service.

      John

        Actually, I think I just figured it out.

        if ($Win32::Daemon::VERSION < 20180000) { Win32::Daemon::AcceptedControls(SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_PAUSE_CONTINUE | SERVICE_ACCEPT_SHUTDOWN | SERVICE_ACCEPT_PARAMCHANGE | SERVICE_ACCEPT_NETBINDCHANGE); }

        The problem seems to be that this should not be in an if statement. For some reason I thought this call did not need to be made for Win32::Daemon version 20181025, which is on this system.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://11107011]
Approved by marto
Front-paged by Discipulus
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (6)
As of 2019-10-14 19:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?