Hi, Andrew Feren wrote: > Something like the following will give you better results. > > my $pid; > if($pid = fork()) { > print(FOUT "running ($pid)\n"); > wait(); > } else { > open(FOR, '>>', 'C:\delme-kid.txt'); > thread(); > close(FOR); > sleep(10); > exit(0); > }
Thanks for the suggestion, but I do not see why this should give better results in combination with Win32::Daemon. As already described the service will get a termination request as soon as the child terminates, if you do use fork. Nevertheless I tested this and it did terminate the service after one loop. The termination request comes from the service control manager. Probably it thinks the service terminated. This doesn't make sense. Especially because it tries to tell a service to stop, which in its opinion did already stop. Nevertheless it does so. This behaviour happens only with fork AFAIK. Regards, Andreas
signature.asc
Description: OpenPGP digital signature