in reply to Exec'd perl running wild on cpu-time

If the nohup helped your problem then I would assume that it's some sort of issue with your os handling STDOUT and STDERR after detaching the terminal. If you are happy with the nohup solution (a good solution) then you could leave it, but if you're still interested in tracking down your bug I would redirect the STDOUT and STDERR to a log as Fastolfe mentioned a couple posts above. This may also solve your problem. You could also take a look at the net::daemon or proc::daemon modules too.
  • Comment on Re: Exec'd perl running wild on cpu-time

Replies are listed 'Best First'.
RE: Re: Exec'd perl running wild on cpu-time
by jeroenes (Priest) on Nov 13, 2000 at 21:25 UTC
    Wow! More useful tips! Yes, I actually already have shifted to the use of 2&>1 >>log.out. This may have solved the problem as well, as I don't recall the day I switched to the redirection. For the curious, the logfile is still empty, but I don't dump any of the data, because the log file clutters up too many bits. I'll certainly look into the deamon-modules.

    It feels like 42...

    Update: I changed the script at several points.

    1. I read the docs on Package and stuff, and I use use strict; now.

    2. The nohup exec command resulted in an immediate exit. I think it should be plain nohup. Anyway, I now use SIG{INT}='IGNORE', and I didn't try the nohup/() variants.

    3. There is more to starting daemons than I thought. I read the Net:: Proc::daemon PODs, and there is a complete sequence needed for detaching from a terminal. Because I don't need sockets for my script, I will use Proc::daemon.

    4. However, I postpone coding this for a while. For now, the script has been running for more than a day now, without problems.

    Thanks to you all!