Jeden Sonntag Apache tot

tanjix

Registered User
Hallo allerseits,

hier ein etwas merkwürdiges Konstrukt unter Debian 3/4 und Confixx 3.x

Jeden Sonntag gegen 06.25 Uhr stürzt der Apache Webserver ab. Log-Auswertungen ergaben, dass zu dieser Zeit das logrotate Script von Confixx aktiv wird.

Im error_log von Apache findet sich:

Code:
[Mon Jul 23 05:20:19 2007] [warn] child process 2732 still did not exit, sending a SIGTERM
[Mon Jul 23 05:20:19 2007] [warn] child process 2733 still did not exit, sending a SIGTERM
[Mon Jul 23 05:20:19 2007] [warn] child process 2734 still did not exit, sending a SIGTERM
[Mon Jul 23 05:20:19 2007] [warn] child process 2735 still did not exit, sending a SIGTERM
[Mon Jul 23 05:20:19 2007] [warn] child process 2750 still did not exit, sending a SIGTERM
[Mon Jul 23 05:20:19 2007] [warn] child process 2760 still did not exit, sending a SIGTERM
[Mon Jul 23 05:20:19 2007] [warn] child process 2761 still did not exit, sending a SIGTERM
[Mon Jul 23 05:20:19 2007] [warn] child process 29306 still did not exit, sending a SIGTERM
[Mon Jul 23 05:20:19 2007] [warn] child process 29310 still did not exit, sending a SIGTERM
[Mon Jul 23 05:20:19 2007] [warn] child process 12566 still did not exit, sending a SIGTERM
[Mon Jul 23 05:20:21 2007] [warn] child process 2732 still did not exit, sending a SIGTERM
[Mon Jul 23 05:20:21 2007] [warn] child process 2733 still did not exit, sending a SIGTERM
[Mon Jul 23 05:20:21 2007] [warn] child process 2734 still did not exit, sending a SIGTERM
[Mon Jul 23 05:20:21 2007] [warn] child process 2735 still did not exit, sending a SIGTERM
[Mon Jul 23 05:20:21 2007] [warn] child process 2750 still did not exit, sending a SIGTERM
[Mon Jul 23 05:20:21 2007] [warn] child process 2760 still did not exit, sending a SIGTERM
[Mon Jul 23 05:20:21 2007] [warn] child process 2761 still did not exit, sending a SIGTERM
[Mon Jul 23 05:20:21 2007] [warn] child process 29306 still did not exit, sending a SIGTERM
[Mon Jul 23 05:20:21 2007] [warn] child process 29310 still did not exit, sending a SIGTERM
[Mon Jul 23 05:20:21 2007] [warn] child process 12566 still did not exit, sending a SIGTERM
[Mon Jul 23 05:20:23 2007] [warn] child process 2732 still did not exit, sending a SIGTERM
[Mon Jul 23 05:20:23 2007] [warn] child process 2733 still did not exit, sending a SIGTERM
[Mon Jul 23 05:20:23 2007] [warn] child process 2734 still did not exit, sending a SIGTERM
[Mon Jul 23 05:20:23 2007] [warn] child process 2735 still did not exit, sending a SIGTERM
[Mon Jul 23 05:20:23 2007] [warn] child process 2750 still did not exit, sending a SIGTERM
[Mon Jul 23 05:20:23 2007] [warn] child process 2760 still did not exit, sending a SIGTERM
[Mon Jul 23 05:20:23 2007] [warn] child process 2761 still did not exit, sending a SIGTERM
[Mon Jul 23 05:20:23 2007] [warn] child process 29306 still did not exit, sending a SIGTERM
[Mon Jul 23 05:20:23 2007] [warn] child process 29310 still did not exit, sending a SIGTERM
[Mon Jul 23 05:20:23 2007] [warn] child process 12566 still did not exit, sending a SIGTERM
[Mon Jul 23 05:20:25 2007] [error] child process 2732 still did not exit, sending a SIGKILL
[Mon Jul 23 05:20:25 2007] [error] child process 2733 still did not exit, sending a SIGKILL
[Mon Jul 23 05:20:25 2007] [error] child process 2734 still did not exit, sending a SIGKILL
[Mon Jul 23 05:20:25 2007] [error] child process 2735 still did not exit, sending a SIGKILL
[Mon Jul 23 05:20:25 2007] [error] child process 2750 still did not exit, sending a SIGKILL
[Mon Jul 23 05:20:25 2007] [error] child process 2760 still did not exit, sending a SIGKILL
[Mon Jul 23 05:20:25 2007] [error] child process 2761 still did not exit, sending a SIGKILL
[Mon Jul 23 05:20:25 2007] [error] child process 29306 still did not exit, sending a SIGKILL
[Mon Jul 23 05:20:25 2007] [error] child process 29310 still did not exit, sending a SIGKILL
[Mon Jul 23 05:20:25 2007] [error] child process 12566 still did not exit, sending a SIGKILL
[Mon Jul 23 05:20:27 2007] [notice] caught SIGTERM, shutting down

Code:
/etc/cron.daily/logrotate:
error: Failed to remove old log /var/log/apache/meinserver.de_access.log.1.gz: No such file or directory (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
error: error running shared postrotate script for /var/log/apache/meinserver.de_access.log
run-parts: /etc/cron.daily/logrotate exited with return code 1

Der Pfas zu der hier genannten Log-Datei existiert aber - genauso wie das Log an sich.

Vermutlich ist es das logrotate script, da er ja schreibt "could not remove old log". Das Script läuft dann weiter und hält den Apache unten (so weit ich das richtig verstanden habe?).

Ich habe aber nichts an den Scripten geändert, es trat auch nicht gleich nach dem Update auf das neue Confixx auf.

Ich könnte den Apache natürlich jeden Tag um 06:25 Uhr wieder neu starten, aber diese Lösung scheint mir nicht sehr elegant!

Hat jemand einen Tipp bei der Hand?
 
Was steht in der /etc/logrotate.conf bzw. /etc/logrotate.d/apache2 ?
Oder gibt es noch weitere Files in /etc/logrotate.d/ in der access_log's rotiertiert werden...?

huschi.
 
Hier der Inhalt der /etc/logrotate.d/apache2

Code:
/var/log/apache2/*.log {
        weekly
        missingok
        rotate 52
        compress
        delaycompress
        notifempty
        create 640 root adm
        sharedscripts
        postrotate
                if [ -f /var/run/apache2.pid ]; then
                        /etc/init.d/apache2 restart > /dev/null
                fi
        endscript
}

Weitere Scripte, die mit apache2 zu tun haben, sind nicht vorhanden.
 
Musste heute genau das selbe Phänomen auf nem vServer mit Debian Etch + SysCP feststellen.

logrotate.d/apache2 ebenfalls identisch.
 
Ein "reload" reicht übrigens bereits. Und das "> /dev/null" sollte man mal raus nehmen wenn man damit Probleme hat, oder?

Genau genommen würde auch schon ein "pkill -HUP httpd" ausreichen.

Und eigentlich will man sowas wie cronolog, dann passiert das Rotieren von selbst.
 
Hallo.

So ein Phänomen kenne ich von sehr stark frequentierten Indianern mit mehreren hundert Prozessen. Zunächst kannst Du nachsehen, ob Du Sonntags morgens zufällig viel Traffik hast. Ist das der Fall gibts zwei Ansätze:

  1. /etc/init.d/apache2 enthält beim case restart eine sleep zwischen stop und start - dann den sleep erhöhen
  2. das ist nicht der Fall - dann aus /etc/init.d/apache2 restart ein /etc/init.d/apache2 stop; sleep 10; /etc/init.d/apache2 start in der logrotate.d/apache2 machen

Hintergrund ist in so einem Falle, dass der Server es in der kurzen Zeit nicht schafft alle Przesse zu killen und somit der pid noch da ist, wenn der start erfolgen soll. Dann startet der Indianer nicht mit der Fehlermeldung, dass es einen unsauberes Beenden gab und hält an.
 
Back
Top