Finden Sie heraus, warum Apache jeden Sonntagmorgen nicht mehr läuft

Finden Sie heraus, warum Apache jeden Sonntagmorgen nicht mehr läuft

Ich habe Apache auf Ubuntu 16.04.4 LTS eingerichtet.

Aus irgendeinem Grund wird Apache jeden Sonntagmorgen ungefähr zur gleichen Zeit beendet.

Wenn es aufhört, laufe ich los systemctl status apache2und sehe:

Mar 04 06:25:24 xxxxxx apache2[11178]:  * Stopping Apache httpd web server apache2

Also wurde Apache irgendwie gestoppt. Wenn es gestoppt ist, ist nichts drin /var/log/apache2/error.log. Wenn ich Apache wieder starte, sehe ich:

[Sun Mar 04 09:44:10.875444 2018] [core:warn] [pid 22442:tid 140355746498432] AH00098: pid file /var/run/apache2/apache2.pid overwritten -- Unclean shutdown of previous Apache run?

Daraus /var/log/sysloglässt sich schließen, dass Apache (auch ProFTPD) neu geladen und dann bei folgendem angehalten wurde 06:25:24:

Mar  4 06:25:11 xxxxxx systemd[1]: Reloading LSB: Apache2 web server.
Mar  4 06:25:11 xxxxxx apache2[11014]:  * Reloading Apache httpd web server apache2
Mar  4 06:25:11 xxxxxx apache2[11014]:  *
Mar  4 06:25:11 xxxxxx systemd[1]: Reloaded LSB: Apache2 web server.
Mar  4 06:25:18 xxxxxx systemd[1]: Stopping LSB: Starts ProFTPD daemon...
Mar  4 06:25:18 xxxxxx proftpd[11083]:  * Stopping ftp server proftpd
Mar  4 06:25:18 xxxxxx proftpd[11083]:    ...done.
Mar  4 06:25:18 xxxxxx systemd[1]: Stopped LSB: Starts ProFTPD daemon.
Mar  4 06:25:18 xxxxxx systemd[1]: Starting LSB: Starts ProFTPD daemon...
Mar  4 06:25:18 xxxxxx proftpd[11094]:  * Starting ftp server proftpd
Mar  4 06:25:18 xxxxxx proftpd[11094]: 2018-03-04 06:25:18,666 xxxxxx proftpd[11104]: mod_dso/0.5: module 'mod_tls.c' already loaded
Mar  4 06:25:18 xxxxxx proftpd[11094]: 2018-03-04 06:25:18,667 xxxxxx proftpd[11104]: mod_dso/0.5: module 'mod_sftp.c' already loaded
Mar  4 06:25:19 xxxxxx proftpd[11094]:    ...done.
Mar  4 06:25:19 xxxxxx systemd[1]: Started LSB: Starts ProFTPD daemon.
Mar  4 06:25:24 xxxxxx apache2[11178]:  * Stopping Apache httpd web server apache2
Mar  4 06:25:24 xxxxxx apache2[11178]:  *

Wie finde ich heraus, warum Apache stoppt oder welcher Prozess Apache stoppt (aus welchem ​​Grund), damit ich verhindern kann, dass dies erneut passiert?

Antwort1

Das Problem wurde durch verursacht logrotate, das Apache beim Rotieren von Protokollen stoppt.

Das Problem wurde durch Bearbeiten /etc/logrotate.d/apache2und Ändern reloadin gelöst graceful.

Original:

postrotate
            if /etc/init.d/apache2 status > /dev/null ; then \
                /etc/init.d/apache2 reload > /dev/null; \
            fi;
endscript

Bearbeitet:

postrotate
            if /etc/init.d/apache2 status > /dev/null ; then \
                /etc/init.d/apache2 graceful > /dev/null; \
            fi;
endscript

verwandte Informationen