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

I've created a service using ActiveState PerlSvc and when I try to start the service under WinXP I get messages saying that the service is starting then that the service could not be started with no error reported.
The service installs okay and can also be removed using the --install and --remove options. Messages are posted to the event log stating that the service was successfully sent install and removal messages.

I've tried starting the service useing the system account as well as my own account (which has network access), but the service simply will not start.

Can anyone provide help??

Thanks!

...Bill
  • Comment on Help with start ActiveState PerlSvc service under WinXP

Replies are listed 'Best First'.
Re: Help with start ActiveState PerlSvc service under WinXP
by locked_user sundialsvc4 (Abbot) on Dec 15, 2010 at 22:39 UTC

    Okay, let’s go with the hypothesis that the service is, in fact, starting ... but that it cannot run in the environment that Windows is presenting to it.   So it wakes up, tries to take its first breath, finds that there is no air, chokes and dies.   (Ooh, hate it when that happens!)   Things to check include... who is the effective userID; what are the permissions; what is the current-directory; environment-variable settings such as PERL5LIB, and so on.   Yes, detective-work.   Good ol’ sleuthing.   No way around it, really.

    Windows logs, including both application and system logs, would of course be a crucial thing to look at –as you well know – but in my experience the app has to “manage to take at least that first breath” before it leaves very much useful information in the logs.   As you have probably seen, it can die without leaving any useful traces.   “Which sucks, but ...”   :-/

    In past lives, I have had to do some really ridiculous things just to get a handle on what is going on.   (And this not limited to Perl...)   Create a file, make it accessible to anyone and everyone, and try to launch a program whose first act is to try to “touch” that file or to write “Hello, world!” to it.   And you look to see if the modification time (or contents) of the file actually did change.   Just to get some clue as to whether the program successfully began running at all...   Usually once you do see the problem, fixing the problem is easy, but seeing the problem ... is hard.

Re: Help with start ActiveState PerlSvc service under WinXP
by Marshall (Canon) on Dec 16, 2010 at 22:13 UTC
    "I've created a service using ActiveState PerlSvc" - That is a huge leap with no code shown for your service. Did you read: PerlSvc Overview?

    You have to add some stuff to your source code in order to make a service. What did you do? When you used PerlSvc to make the .exe, I hope that you used the defaults to make a standalone service, but you don't say. Whether or not your account has network access doesn't matter - get your service to run on your machine and use it by a local program before trying to get other machines involved. Start by making some super simple service and I would search the web for some simple example.