zejames has asked for the wisdom of the Perl Monks concerning the following question:
and I have this :use Win32::Daemon; # Tell the OS to start processing the service... Win32::Daemon::StartService(); print "Waiting...\n"; # Wait until the service manager is ready for us to continue... print "SERVICE_NOT_READY " . SERVICE_NOT_READY . "\n"; print "SERVICE_STOPPED " . SERVICE_STOPPED . "\n"; print "SERVICE_RUNNING " . SERVICE_RUNNING . "\n"; print "SERVICE_PAUSED " . SERVICE_PAUSED . "\n"; print "SERVICE_START_PENDING " . SERVICE_START_PENDING . "\n"; print "SERVICE_STOP_PENDING " . SERVICE_STOP_PENDING . "\n"; print "SERVICE_CONTINUE_PENDING " . SERVICE_CONTINUE_PENDING . "\n"; print "SERVICE_PAUSE_PENDING " . SERVICE_PAUSE_PENDING . "\n"; while( SERVICE_START_PENDING != Win32::Daemon::State() ) { sleep( 1 ); print Win32::Daemon::State() . "\n"; } print "Running...\n"; # Now let the service manager know that we are running... Win32::Daemon::State( SERVICE_RUNNING ); # Okay, go ahead and process stuff... unlink( glob( "c:\\temp\\*.tmp" ) ); # Tell the OS that the service is terminating... Win32::Daemon::StopService();
Waiting... SERVICE_NOT_READY 0 SERVICE_STOPPED 1 SERVICE_RUNNING 4 SERVICE_PAUSED 7 SERVICE_START_PENDING 2 SERVICE_STOP_PENDING 3 SERVICE_CONTINUE_PENDING 5 SERVICE_PAUSE_PENDING 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 Terminating on signal SIGINT(2)
20040915 Edit by castaway: Changed title from 'Problems with Win32::Daemon'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Win32::Daemon service doesn't reach RUNNING state
by BrowserUk (Patriarch) on Sep 14, 2004 at 11:17 UTC | |
by zejames (Hermit) on Sep 14, 2004 at 11:29 UTC | |
by BrowserUk (Patriarch) on Sep 14, 2004 at 11:35 UTC | |
by zejames (Hermit) on Sep 14, 2004 at 11:42 UTC | |
by BrowserUk (Patriarch) on Sep 14, 2004 at 12:18 UTC | |
| |
|
Re: Win32::Daemon service doesn't reach RUNNING state
by SwaJime (Scribe) on May 23, 2019 at 14:09 UTC | |
by haukex (Archbishop) on May 23, 2019 at 18:57 UTC |