with the default cronbase i get a lot of mail when running vixie-cron, created by the /usr/sbin/run-crons program/script. basicly it comes from the lock-mechanism. i did some minor changes to the script and now it runs smoothly and without any probs as far as i can see. mail output from unfixed cron-messages: +---------------------------------------------------------- X-Original-To: root Delivered-To: root@localhost From: Cron Daemon <root@localhost> To: root@localhost Subject: Cron <root@localhost> test -x /usr/sbin/run-crons && /usr/sbin/run-crons X-Cron-Env: <SHELL=/bin/bash> X-Cron-Env: <PATH=/sbin:/bin:/usr/sbin:/usr/bin> X-Cron-Env: <MAILTO=root> X-Cron-Env: <HOME=/> X-Cron-Env: <LOGNAME=root> Date: Fri, 19 Mar 2004 21:04:00 +0100 (CET) cat: /var/spool/cron/lastrun/lock: No such file or directory +---------------------------------------------------------- i ll attach my version. basic problem is imho that another cron-process comes between the [ -f lockfile ] and the grabbing for the pid out of the lockfile. regards, mathias Reproducible: Always Steps to Reproduce: 1. 2. 3.
Created attachment 27641 [details] new run-crons version
Comment on attachment 27641 [details] new run-crons version damn, this is the original :)
Created attachment 27642 [details] new run-crons version
Created attachment 30876 [details] better version with non-racy locking I'll get this in once I actually test it
Sorry, I'll make sure to add you to the credits too... My code includes some of your changes.
Created attachment 30877 [details] added credit
works ok so far except for the warning that in line 32 the -lt is syntactilly wrong ... ((i=0; i < 2; i=i+1)) should do the trick, regards, mathias
I'm getting mail with the "kill" usage output: Usage: kill pid ... Send SIGTERM to every process listed. kill signal pid ... Send a signal to every process listed. kill -s signal pid ... Send a signal to every process listed. kill -l List all signal names. kill -L List all signal names in a nice table. kill -l signal Convert between signal numbers and names. I'm assuming it's because the lockfile doesn't exist, so in run-crons when it gets to the line if `kill -0 $cronpid >/dev/null 2>&1` $cronpid is empty, so kill outputs the usage info. But, shouldn't the line if test -f /var/spool/cron/lastrun/lock keep it from getting to that point without a pid? Is the problem I'm experiencing related to this bug?
Ok, it's in portage as cronbase-0.3. And yes Duke, this should solve the problem you described.
Thank you!