A patch to add logging to /usr/sbin/run-crons. run-crons itself doesn't do any logging, which can make debugging crons rather difficult, as all one can usually see in the cron log is /usr/sbin/run-crons being run every ten minutes. The logging format is meant to look like vixie-cron's.
Created attachment 92053 [details, diff] Logging patch for run-crons
run-crons is used by all cron daemons, so any changes have to work with all versions of cron also, instead of forking `whoami`, why not just use $USER
It'll work with any crons; it's just calling the standard logger(1) program, and using a facility/prio of cron.info so it goes to the right place. The only relation to vixie cron is that I modeled the log message format after it. As for $USER, I was staying away from env vars because they're not particularly reliable for accounting purposes. Although in the case of a root/system crontab I can't see how it could be compromised, so it'll do.
checking for the existence of logger would also be a little more safe (dont know if the bsds have logger) and all scripts are run by root anyway, so no need for whoami... or not? this looks good though, i'll likely put it in...
included in cronbase-0.3.3. thanks...