[NBLUG/talk] Odd cron problem

Walter Hansen gandalf at sonic.net
Sat Dec 18 11:08:06 PST 2004


I've got a perl program that forks itself and then redirects output to a
file to run as a daemon. I've now implemented a little shell script that
simply runs 11 such processes with command line options so each logs to a
different file. I also have a cron event that starts these at a certain
time as user root. I used to have 11 cron events, one for each process,
but decided it would be simpler to have cron start one script that starts
them all.

Now when I run the script manually, everything goes fine. When I had cron
start each process individually everything went fine. But when I have the
script start them through cron the log files all show up as if I'd issued
a touch command (size 0). They should start getting information
immediately and then slow down to more every minute or so. I think perhaps
it's somehow being buffered, but I don't see how as all I've done is place
the program startup commands in the script file and made it executable.
Perhaps I'm missing something. It's been a while since I've fooled with
shell scripts.

[root at abco nus]# cat attacktonight
/root/nus/nus --die 30 --user marilyn
/root/nus/nus --die 30 --user walter
/root/nus/nus --die 30 --user robert
/root/nus/nus --die 30 --user danny
/root/nus/nus --die 30 --user donald
/root/nus/nus --die 30 --user mary
/root/nus/nus --die 30 --user dennis
/root/nus/nus --die 30 --user arron
/root/nus/nus --die 30 --user kevin
/root/nus/nus --die 30 --user marci
/root/nus/nus --die 30 --user jill
[root at abco nus]#

No, despite the name, this is not a malicious program. It's a competitive
program and the admin of the other system is well aware of this process as
well as all the others that do similar things.





More information about the talk mailing list