flamewalker
Verified User
- Joined
- Aug 21, 2007
- Messages
- 64
I have a VPS with Directadmin on it, and the server has been having some serious up and down issues lately. Every time it comes back up, Exim dies at least a couple times. The last time I found a log entry, something about not being able to read the delivery status.
At any rate, I have a script that checks if exim is running, if not, restart. However, it doesn't seem to be able to detect the fact that exim is dying but the pid file remains.
Any tips to modify my code so that it can check if the program is actually running, regardless if the pid file exists, so it can restart it?
The last log file when it crashed, in paniclog:
Thanks in advance!
PS - it hasn't crashed since then. But if/when the server goes down again, I want to make sure exim will keep restarting until I can troubleshoot it. Usually its a bayes file that was open when the server crashed
At any rate, I have a script that checks if exim is running, if not, restart. However, it doesn't seem to be able to detect the fact that exim is dying but the pid file remains.
Code:
#!/bin/bash
progname=exim
[email protected]
[email protected]
[email protected]
if [ "$(/sbin/pidof $progname)" = "" ]; then
/etc/rc.d/init.d/exim start;
mail -s "$progname on $(hostname) restarted at $(date)" $email < .;
mail -s "$progname on $(hostname) restarted at $(date)" $email2 < .;
mail -s "$progname on $(hostname) restarted at $(date)" $email3 < .;
fi
Any tips to modify my code so that it can check if the program is actually running, regardless if the pid file exists, so it can restart it?
The last log file when it crashed, in paniclog:
Code:
2012-12-20 09:52:43 1TlkGc-0008Qg-Av failed to read delivery status for [email protected] from delivery subprocess
Thanks in advance!
PS - it hasn't crashed since then. But if/when the server goes down again, I want to make sure exim will keep restarting until I can troubleshoot it. Usually its a bayes file that was open when the server crashed
