Cron/Sendmail Defunct Processes
I have a cron script ( http://pastebin.ca/803903 ). I edited crontab using "crontab -e" and added the line ( http://pastebin.ca/803905 ). I DO have sendmail installed and running (I have send emails successfully from command line and also php scripts).
My problem is as follows: When the anope services daemon is not running, the cron script starts it, and outputs some text (Which I want to to be emailed to me). But cron opens up defunct zombie processes for sh and sendmail and I must kill the cron process.
The output of "ps -ef" showing the defunct processes is at http://pastebin.ca/803916
The sendmail process stays there until I kill the "/USR/SBIN/CRON" process.
How can I solve this? All I want is to be emailed when the services daemon isn't found. I'm running Ubuntu 7.10 Gusty.
If there's no errors in the services log, then what happens if you change the "./$ANOPROG" line to "exec ./$ANOPROG"? BTW this script is different from the default one in Anope 1.6.5? And the 6 line "if [ `ps auwx | grep $ANOPROG" if statement can be replaced with one "pgrep -f "ANOPATH/$ANOPROG 2>&1>/dev/null" && exit 0".
Well the issue isn't the fact that the services aren't starting or anything. I just want to be emailed with the output of the cron script. Instead of getting emailed, cron creates zombie sendmail processes which never die or send the email.
I tested this by manually stopping the services, then waiting 10 minutes for the cron script to run. The cron script runs, and the services start back up, but I never get the email from the output of the cron script. The sendmail process that started from cron freezes up somehow for some reason and becomes a defunct zombie process.
Basically all I want is to be notified with the output of cron. I don't know if this is a cron problem or a sendmail problem.
I actually switched from sendmail to exim4 after making that original post, and it does the same exact thing.
|All times are GMT -5. The time now is 01:13 PM.|