When squid is not running, i.e. /var/run/squid.pid is not present this cron job exits with a error level 1 status, but no output indicating the error. Then I get silly emails from cron :( I'd really like this script to exit error level 0 if it cannot find that file. I'll attach a patch that works to my desire. Thanks!
Created attachment 111016 [details, diff] Patch to squid.cron This makes it so that this cron job only executes if it can find the squid pid file, otherwise it silently exits
huh? what cron daemon do you use? My vixie-cron don't send emails unless scripts actually write something to stdout or stderr, regardless of what their return code might be.
I use: [ebuild R ] sys-process/fcron-3.0.2 USE="-debug -doc pam (-selinux)" The message subject: fcron <root@server> /bin/run-parts /etc/cron.weekly The message body: run-parts: /etc/cron.weekly/squid.cron exited with return code 1 Job /bin/run-parts /etc/cron.weekly terminated (exit status: 1) (mailing output)
Fixed in squid-2.6.9-r1. Thanks!