Re: [Hampshire] Cron script spawning too many programs?

Top Page
Author: Hugo Mills
Date:  
To: Hampshire LUG Discussion List
Subject: Re: [Hampshire] Cron script spawning too many programs?

Reply to this message
gpg: failed to create temporary file '/var/lib/lurker/.#lk0x567ad100.hantslug.org.uk.30586': Permission denied
gpg: keyblock resource '/var/lib/lurker/pubring.gpg': Permission denied
gpg: Signature made Wed Mar 4 20:45:19 2009 GMT
gpg: using DSA key 20ACB3BE515C238D
gpg: Can't check signature: No public key
On Wed, Mar 04, 2009 at 08:37:57PM +0000, AdamC wrote:
> Can anyone think of a reason why when cron executes a script many more
> programs start (at least over 5), but when I run the script from a
> shell, I get the correct amount of programs running that I am
> expecting?
>
> I have a small script (see below) that scans a directory for .torrent
> files and then starts a btdownloadcurses instance for each file. If I
> start the script from the shell, and I have 2 .torrent files in that
> directory, then I get 2 instances of btdownloadcurses running.
>
> However, if cron runs this script then I get a lot more
> btdownloadcurses running than I expected and it pretty much makes the
> nslu2 crawl along (until I manage to kill the processes).
>
> Any thoughts what might be going on here?


cron usually runs with a severely restricted set of environment
variables. Try printing out the environment in the script (with "set")
and seeing if there's anything in there that would affect it.

My guess is that it's running in the wrong directory.

Hugo.

-- 
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
  PGP key: 515C238D from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
    --- We demand rigidly defined areas of doubt and uncertainty! ---