From: OXx <[EMAIL PROTECTED]> > Hello all, > I try to launch my perl application as a windows service. > I compile it with PAR so I have mysoft.exe > Then i installed win32::daemon, no problem. > I try this script so: > > use Win32::Daemon; > > %Hash = ( > machine => '', > name => 'PerlTest', > display => 'Oh my GOD, Perl is a service!', > path => 'c:\\mysoft.exe', > user => '', > > pwd => '', > description => 'First prog as service', > parameters =>'', > ); > if( Win32::Daemon::CreateService( \%Hash ) ) > { > print "Successfully added.\n"; > > } > else > { > print "Failed to add service: " . Win32::FormatMessage( > Win32::Daemon::GetLastError() ) . "\n"; > } > > The service is installed ok but I have an error when I try to start > the service! > http://www.eventid.net/display.asp?eventid=7009&eventno=655&source=Ser > vice%20Control%20Manager&phase=1 Its a timeout error and I don'kow how > to solve my problem...
The service needs to register with the Service Manager once it starts. If it doesn't do that in time, Service Manager kills it. I believe the Win32::Daemon docs contain a complete template for services including this. You may also try to use Win32::Daemon::Simple instead and have this taken care of automatically. http://jenda.krynicky.cz/#Win32::Daemon::Simple Jenda ===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz ===== When it comes to wine, women and song, wizards are allowed to get drunk and croon as much as they like. -- Terry Pratchett in Sourcery -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>