and no service is created. Is there any parameter needs to pass while running the script. And what exactly is the following for:else { die "Nothing to do\n"; }
What exactly is GetOptions for. I tried to modify thie above scripty and put the following code in the else part:my %opt; GetOptions ( \%opt, "run", "install", "remove", "start", "stop", "restart", "pause", "resume|continue", );
now I run the script and service gets created and can start,stop,resume etc.. the service under services. I don't if it's the right way. Any comments will be really appeciated. Thankselse { #die "Nothing to do\n"; &removeService(); &installService(); my $cmd = 'net start $serviceConfig{name}'; my $results = `$cmd`; if($!) { &debug("Net Start returned error: $@\n" . $results); die "ERROR"; } #don't know what is this for my %context = { last_state => SERVICE_STOPPED, count => 0, start_time => time(), }; Win32::Daemon::StartService( \%context, 3000 ); exit(); }
In reply to Re^4: Perl script as windows service
by rockets12345
in thread Perl script as windows service
by rockets12345
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |