Exim love apache

Well, is seems to work pretty well.

I think that when you did a restart and had the "Usage: pstree ..." error Apache was already stopped (maybe crashed), and the new command (with "2>/dev/null") will make it silent.

On the other way it's weird that you had the "could not bind to address" error once, this may have been caused by a stuck/zombie process (kill -9 didn't kill it) that took a few minutes to exit, since you were able to restart Apache the second time.
Unfortunately there is no way to fix that, let's hope it doesn't happen again. If it does let me know, I may write an addictional retry function as a workaround.
 
httpd just went offline and restarting through SSH didnt work.

This was the error i got when trying to restart httpd:
(98)Address already in use: make_sock: could not bind to address [::]:80
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs

Stopping Exim didnt work either:
# /sbin/service exim stop
Shutting down exim: /etc/init.d/exim: line 40: kill: (1310) - No such process

I just kept trying and kept trying and I kept getting these errors, two minutes later it was online again... :(
 
Allright, try using this:
Code:
  restart)
	httpd_childs=$(pstree -p $(ps u -C httpd |grep ^root |awk '{print $2}') 2>/dev/null |egrep -o '\([[:digit:]]+\)' |tr -d '()')
	stop
	waitforexit "httpd" 20
	for pid in $httpd_childs; do kill -9 $pid 2>/dev/null; done
	listening_procs=$(netstat -pln |grep ':80 ' |tr / ' ' |awk '{print $7}' |sort -u)
	for pid in $listening_procs; do kill -9 $pid 2>/dev/null; done
	start
	;;

Now you have two workarounds in one ;) that should work.
 
Alright, I'll test it out. If the problem is fixed I'll buy you a present on Amazon.com for the trouble I caused you. Thanks alot Tillo!
 
Back
Top