Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Perl script as Windows Service

by just joined (Initiate)
on Jun 12, 2007 at 11:24 UTC ( #620695=perlquestion: print w/ replies, xml ) Need Help??
just joined has asked for the wisdom of the Perl Monks concerning the following question:

I tried running a Perl Script as a windows service. When I start the service in Services ,it is running for a while and my script is also getting loaded.But an error is generated like: Error 1053: The service did not respond to the strt or control request in a timely fashion. and the service is getting stopped. What does this mean?

Comment on Perl script as Windows Service
Re: Perl script as Windows Service
by McDarren (Abbot) on Jun 12, 2007 at 11:33 UTC
    Well, it means that the service did not respond to the start or control request in a timely fashion.

    Did you consider googling for that error message? Try it - just for kicks :)

    --Darren

      yes I tried in google. But couldn't get what to do?
Re: Perl script as Windows Service
by marto (Chancellor) on Jun 12, 2007 at 12:09 UTC
Re: Perl script as Windows Service
by cdarke (Prior) on Jun 12, 2007 at 13:50 UTC
    Have you written your script specifically as a service? On Windows a service has to communicate with the Service Control Manager(SCM). The Services GUI is just a way of asking the SCM to do things.
    Think of the SCM as your Mother (OK, or Father) - when starting up you must tell her how long you are going to take over each startup phase, and if you take too long she panics and thinks you have died. That is what seems to have happened here. Did you specify a long enough period between each startup checksum? Did you remember to set the service status?
    The SCM also asks you to do things from time-to-time (Suspend, Resume, Shutdown) or even if you are OK. Again, a failure to respond in a timely manner throws the old dear into a flap.
Re: Perl script as Windows Service
by jdtoronto (Prior) on Jun 12, 2007 at 15:52 UTC
    A darned good reason to use the PDK from the good folks at ActiveState. With pretty much no knowledge of the internals of Windows (a state of blissful ignorance I choose to perpetuate) I have successfully written both services and tray apps, including a service with a tray app front end. Worth looking at.

    jdtoronto

Re: Perl script as Windows Service
by JSchmitz (Canon) on Jun 12, 2007 at 19:15 UTC
    SRS service hung while Setup was trying to start it have you looked in the event logs that may point you in the right direction - I also agree that you should be using ActiveState tools - very helpful for stuff like this.

    On windows you need to either compile it with ActiveState's PerlSvc, use Dave Roth's Win32::Daemon module or Jenda's Win32::Daemon::Simple module.

    - cheers!
      I used Win32::daemon to create and start a service.This service in turn runs a perl script . When I start the service,the perl script is running well but because of the error ,the service is getting stopped automatically.
Re: Perl script as Windows Service
by dj_goku (Novice) on Jun 13, 2007 at 05:27 UTC

    This link has the whole process I used to create a windows service:

    http://mail.pm.org/pipermail/kc/2007-May/000711.html

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (14)
As of 2014-08-01 15:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who would be the most fun to work for?















    Results (27 votes), past polls