apache getting stuck

not for me, still does it when exim is shut down. Looking in netstat it still shows connections on port 80
 
Just replace the restart part of /etc/init.d/httpd with:

Code:
  restart)
        stop
        waitforexit "httpd" 20
        kill -9 `netstat -lnp | grep ':80 ' | awk '{print $7}' | awk -F "/" '{print $1}'`
        kill -9 `netstat -lnp | grep ':443 ' | awk '{print $7}' | awk -F "/" '{print $1}'`        
        start
        ;;

Works for me :)
 
Just replace the restart part of /etc/init.d/httpd with:

Code:
  restart)
        stop
        waitforexit "httpd" 20
        kill -9 `netstat -lnp | grep ':80 ' | awk '{print $7}' | awk -F "/" '{print $1}'`
        kill -9 `netstat -lnp | grep ':443 ' | awk '{print $7}' | awk -F "/" '{print $1}'`        
        start
        ;;

Works for me :)

this works, thank you
 
Someone, who doesn't need exim very much - please try to comment out exim.pl from exim.conf, I guess it's causing problems.
 
Last edited:
At least several posters have had the problem and it wasn't exim, so I'm not sure what this proves.

Martynas, have you ever seen exim.pl in the netstat output? exim.pl of course isn't a daemon; it should be called for each email but of course shouldn't hang around.

John, what do you think? Is there anything in exim.pl that you think could be causing the problem?

Jeff
 
well i didnt think it was exim but after checking netstat lately it was so I think its exim for sure
 
Jeff, yes, I'm sure exim is causing the problem. Exim.pl isn't a daemon, but it's used by exim daemon. Here you are lsof ;) As you see - it's using apache's files.

Code:
exim      15135     root    7w      REG        8,2      8240  
29016088 /var/log/httpd/error_log
exim      15135     root    8w      REG        8,2      1660    
511063 /var/log/httpd/domains/dddd.info.error.log
exim      15135     root    9w      REG        8,2    481770    
511064 /var/log/httpd/domains/ccccc.com.error.log
exim      15135     root   10w      REG        8,2    561481    
511065 /var/log/httpd/domains/bbbbb.com.share.error.log
exim      15135     root   11w      REG        8,2      6013    
511066 /var/log/httpd/domains/bbbbb.com.error.log
exim      15135     root   12w      REG        8,2    461928    
511067 /var/log/httpd/domains/dddd.in.error.log
exim      15135     root   13w      REG        8,2      1386    
511068 /var/log/httpd/domains/aaaa.com.error.log
exim      15135     root   14w      REG        8,2     12651  
29016526 /var/log/httpd/access_log
exim      15135     root   15w      REG        8,2        12    
511061 /var/log/httpd/domains/dddd.info.bytes
exim      15135     root   16w      REG        8,2       739    
511069 /var/log/httpd/domains/dddd.info.log
exim      15135     root   17w      REG        8,2        12    
511061 /var/log/httpd/domains/dddd.info.bytes
exim      15135     root   18w      REG        8,2       739    
511069 /var/log/httpd/domains/dddd.info.log
exim      15135     root   19w      REG        8,2    752054    
511057 /var/log/httpd/domains/ccccc.com.bytes
exim      15135     root   20w      REG        8,2 109257281    
511070 /var/log/httpd/domains/ccccc.com.log
exim      15135     root   21w      REG        8,2    752054    
511057 /var/log/httpd/domains/ccccc.com.bytes
exim      15135     root   22w      REG        8,2 109257281    
511070 /var/log/httpd/domains/ccccc.com.log
exim      15135     root   23w      REG        8,2     76224    
511040 /var/log/httpd/domains/bbbbb.com.share.bytes
exim      15135     root   24w      REG        8,2   3734211    
511071 /var/log/httpd/domains/bbbbb.com.share.log
exim      15135     root   25w      REG        8,2     76224    
511040 /var/log/httpd/domains/bbbbb.com.share.bytes
exim      15135     root   26w      REG        8,2   3734211    
511071 /var/log/httpd/domains/bbbbb.com.share.log
exim      15135     root   27w      REG        8,2      4881    
511052 /var/log/httpd/domains/bbbbb.com.bytes
exim      15135     root   28w      REG        8,2    192146    
511072 /var/log/httpd/domains/bbbbb.com.log
exim      15135     root   29w      REG        8,2      4881    
511052 /var/log/httpd/domains/bbbbb.com.bytes
exim      15135     root   30w      REG        8,2    192146    
511072 /var/log/httpd/domains/bbbbb.com.log
exim      15135     root   31w      REG        8,2    797992    
511045 /var/log/httpd/domains/dddd.in.bytes
exim      15135     root   32w      REG        8,2  56896838    
511073 /var/log/httpd/domains/dddd.in.log
exim      15135     root   33w      REG        8,2    797992    
511045 /var/log/httpd/domains/dddd.in.bytes
exim      15135     root   34w      REG        8,2  56896838    
511073 /var/log/httpd/domains/dddd.in.log
exim      15135     root   35w      REG        8,2         0    
511049 /var/log/httpd/domains/aaaa.com.bytes
exim      15135     root   36w      REG        8,2         0    
511074 /var/log/httpd/domains/aaaa.com.log
exim      15135     root   37w      REG        8,2         0    
511049 /var/log/httpd/domains/aaaa.com.bytes
exim      15135     root   38w      REG        8,2         0    
511074 /var/log/httpd/domains/aaaa.com.log
exim      15135     root   39w      REG        8,2     73264  
29016529 /var/log/httpd/homedir.log
exim      15135     root   40w      REG        8,2     73264  
29016529 /var/log/httpd/homedir.log
exim      15135     root   41w      REG        8,2     73264  
29016529 /var/log/httpd/homedir.log
exim      15135     root   42w      REG        8,2     73264  
29016529 /var/log/httpd/homedir.log
exim      15135     root   43w      REG        8,2     73264  
29016529 /var/log/httpd/homedir.log
exim      15135     root   44w      REG        8,2     73264  
29016529 /var/log/httpd/homedir.log
exim      15135     root   45w      REG        8,2     73264  
29016529 /var/log/httpd/homedir.log
exim      15135     root   46w      REG        8,2     73264  
29016529 /var/log/httpd/homedir.log
exim      15135     root   47w      REG        8,2     12651  
29016526 /var/log/httpd/access_log
exim      15135     root   48w      REG        8,2         0  
29016530 /var/log/httpd/ssl_request_log
exim      15135     root   49w      REG        8,2         0  
29016882 /var/log/httpd/ssl_mutex.14811 (deleted)
exim      15135     root    3u     IPv4     157531                  TCP *:http
(LISTEN)
exim      15135     root    4u     IPv4     157536                  TCP
*:https (LISTEN)
exim      15136     mail    3u     IPv4     157531                  TCP *:http
(LISTEN)
exim      15136     mail    4u     IPv4     157536                  TCP
*:https (LISTEN)
 
Last edited:
Ah.. and before lsof, "service apache restart" was done with this result:
Code:
Stopping httpd:                                            [FAILED]
Starting httpd: (98)Address already in use: make_sock: could not bind to 
address 0.0.0.0:443
no listening sockets available, shutting down
Unable to open logs
                                                           [FAILED]

So, only "killall -9 exim" could help in this situation :)
 
If it's exim.pl, couldn't we just do:
Code:
killall -9 exim.pl
?
Should one of these killall lines be added to the httpd restart command? Or even to the httpd start command?

Jeff
 
exim.pl is used by /usr/sbin/exim (and exim.pl isn't a process), because of
Code:
perl_startup = do '/etc/exim.pl'

So, it's "included" into exim :) We shouldn't use workarounds, we should use real fixes, don't you think so? :)
 
Sure. Create the fix ;) !

That's the beauty of opensource, you can do it instead of complain about it :D .

Jeff
 
Sure. Create the fix ;) !

That's the beauty of opensource, you can do it instead of complain about it :D .

Jeff

Has anyone created a fix?

Before a fix is found, I have to use a cronjob to restart apache every four hours a day!

I am running apache2 and I have commented out the ErrorLog lines in all the virtual_host*.conf template config files.
 
exim.pl IS found in the process list when it's running. And that change I mentioned to the apache script may very well resolve the problem. If it does, it IS the fix, and adding it to the restart script IS the right way to fix it.

But someone needs to test it first.

Jeff
 
jlasman, as you see in lsof - it's exim, and not exim.pl, but in exim (not exim.pl) there are no such paths as /var/log/httpd/domains/aaaa.com.bytes etc. Don't you think so? "killall -9" won't ever be a fix, because it IS really a workaround, I never recommend to use "-9" flag, because it can damage the process (file or something more), if you don't think that it's true - try to kill mysql with "-9" few times a day and you will see some damaged databases. ;)
 
Jeff, yes, I'm sure exim is causing the problem. Exim.pl isn't a daemon, but it's used by exim daemon. Here you are lsof ;) As you see - it's using apache's files.

Code:
exim      15135     root    7w      REG        8,2      8240  
29016088 /var/log/httpd/error_log
exim      15135     root    8w      REG        8,2      1660    
511063 /var/log/httpd/domains/dddd.info.error.log
exim      15135     root    9w      REG        8,2    481770    
511064 /var/log/httpd/domains/ccccc.com.error.log
...
exim      15135     root   49w      REG        8,2         0  
29016882 /var/log/httpd/ssl_mutex.14811 (deleted)
exim      15135     root    3u     IPv4     157531                  TCP *:http
(LISTEN)
exim      15135     root    4u     IPv4     157536                  TCP
*:https (LISTEN)
exim      15136     mail    3u     IPv4     157531                  TCP *:http
(LISTEN)
exim      15136     mail    4u     IPv4     157536                  TCP
*:https (LISTEN)

smtalk, how did you capture the above?

In my case it is definitely MySQL as when the load is high I see a lot of MySQL connections. After clicking "stop" followed by "start" for MySQL, the connection numbers suddenly drop down to 2 or 3. Also when the CPU upload shoots up to 16, I see MySQL is taking up 99% of the CPU.

How can I pin-point which domain/script is causing this problem? Now I am running vtx's modified script for the apache restart section every two hours. But from the DA control panel I see I can manually "stop" and then "start" MySQL. How can I do it automatically, that is, writing a simple script and then execute it using a cronjob? Like smtalk says, it killing MySQL with "-9" flag a few times a day can damage databases, how can I avoid using that flad. If I do it manually a few times a day, would this damage my databases?
 
Last edited:
OK, I quit using vtx's modified apache restart script. I now run this crontab every two hours:

Code:
15 */2 * * * /sbin/service mysqld restart

Would this create problem for my databases? How can I do a graceful restart rathen than a sudden stop and start?

Then the still remaining question of how to track down which database has been used to jump up my CPU usage to 99% - any tip will be appreciated.
 
Back
Top