in reply to Re: Can't Stop my PerlSvc
in thread Can't Stop my PerlSvc

An excellent idea. I have spent some time trying to get that to work without luck.

I see my service program start in task manager and then I see my real program start for a couple seconds and then go away. Win32::GetLastError() says "Overlapped I/O operation is in progress."

I'll continue to troubleshoot. Any idea what that message means?

Replies are listed 'Best First'.
Re^3: Can't Stop my PerlSvc
by bsdz (Friar) on Sep 21, 2004 at 09:01 UTC
    • What is a CTS server and doesn't it use standard protocols such as HTTP or FTP? If not what is the protocol spec?
    • Do you have a copy of server code? I imagine it's something like: -
      while (sleep 2) { foreach my $site (@sites) { BackupLogFiles($site) if (BetweenHoursOf($maintenance_start,$maintenance_stop)); } }
    • Also in your sample code I noticed that you make the test: -
      if (BetweenHoursOf($maintenance_start,$maintenance_stop));
      in BackupLogFiles and your continuous loop, is that neccesary?
      1) CTS is a Telephony server that produces about 2gigs of logs files per day. I'm using perl to compress/purge and back up those log files.

      2) Your example is right on.

      3) Each server has many log files. Each log could take about 20 minutes to backup so each time I start a new one I have to make sure I'm still within the maintenance window.

      It took me most of the day to figure out why the program would die after the service started it. Turns out a database connection parameter was not being passed in correctly causing "DBI->connect" to fail, which die's. I didn't have it wrapped in an "eval{}" block to trap it because I didn't know it would die. I thought I could just check "DBI->err" after the call. NOT! Another damn forehead smudge on my screen......

      Your idea and your help were excellent. I bow to your wisdom as a lowly scribe should! Thanks again, it's works perfect now.

      1) Our CTS server is a Telephony Proxy Server that produces log files daily of about 2gigs. A perl process compress those down to about 140meg and the process I'm working on now, transfers those zipped files to a management server. So the CTS server doesn't have much to do with my problem. My process transfers the files just fine, it's just that I can't stop the process by 'net stop CspBkpSvc'. My guess was that a long running transfer (140megs from east to west coast) could not be stopped in the middle but I need it to.

      2) Your loop example is right. I start processing backup transfers if we are still in the maintenance window.

      3) For each site to backup there may be 1 or many logs. Since a file transfer can take 15-20 minutes I need check to see if I am still in the maintenance window before I start the next transfer. Thus the several 'BetweenHoursOf' checks.

      I think I have figured out why the program wouldn't keep running after launched from the service per your example. It has to do with not reading it's config file right. So I'm getting on top of the binding and extracting of files in PerlSvc and hope to have it figured out today. I'll post back.

      I don't appear to be able to reply. Did this one work?
        yes