Garden Dwarf has asked for the wisdom of the Perl Monks concerning the following question:
I'm using Win32::Daemon::Simple amongst with Perl Packer (pp) to generate an exe from a perl script. Then - as an administrator - I start the exe, and install the service. After that, in the task manager -> services, I start the service.
I can check the service activity as it writes into a file. And it seems to execute without problems. What I do not understand is that into the task manager -> services, the service state is "starting" and not "running". Therefore I cannot ask the service to stop, I have to kill the process instead. Which is not very nice.
The script looks like this (well, I removed a lot of lines to go to the essential):#!/bin/perl use strict; use warnings; use Data::Dumper; use FindBin; use Win32::Daemon; use Win32::Daemon::Simple Service => 'Service_name', Name => 'Service name', Version => '0.3', Info => { display => 'myService', description => 'My service', user => '', pwd => '', interactive => 0, }, Params => { # the default parameters Tick => 0, Talkative => 0, Interval => 1, # minutes LogFile => 'mylogfile.txt'}; ServiceLoop(\&doTheJob); exit(0); sub doTheJob{ ### Here I write some lines into a file }
I'm developing with Strawberry and running the service on Windows Server 2012
I anyone has a clue, I will be grateful! Thank you in advance :)
|
|---|