Arret d'apache sans raison

Tags: #<Tag:0x00007f509fd56870> #<Tag:0x00007f509fd565f0>

la tout fonctionne nikel et si je fais un simple cerbot renew tout est nikel

Bon, on ne saura pas pourquoi :wink: Problème d’IP, de DNS, tâche cron en double ?
Il est possible qu’il y ait eu trop de tentatives de renouvellement en échec, ce qui conduit à bloquer les demandes pendant un certain temps (voir les explication sur le site web de LetsEncrypt).

1 J'aime

mon pb est encore la…

févr. 04 08:47:52 Next systemd[1]: apache2.service: Main process exited, code=exited, status=1/FAILURE
févr. 04 08:47:52 Next systemd[1]: apache2.service: Killing process 2176407 (apache2) with signal SIGKILL.

les deux lignes sortent de quoi? /var/log/syslog

Feb  4 08:44:22 Next systemd[1]: Starting Certbot...
Feb  4 08:46:21 Next dhclient[614]: DHCPDISCOVER on eno1 to 255.255.255.255 port 67 interval 3
Feb  4 08:46:24 Next dhclient[614]: DHCPDISCOVER on eno1 to 255.255.255.255 port 67 interval 4
Feb  4 08:46:28 Next dhclient[614]: DHCPDISCOVER on eno1 to 255.255.255.255 port 67 interval 10
Feb  4 08:46:38 Next dhclient[614]: DHCPDISCOVER on eno1 to 255.255.255.255 port 67 interval 12
Feb  4 08:46:50 Next dhclient[614]: DHCPDISCOVER on eno1 to 255.255.255.255 port 67 interval 17
Feb  4 08:47:00 Next crowdsec[3879183]: 127.0.0.1 - [Fri, 04 Feb 2022 08:47:00 CET] "POST /v1/watchers/login HTTP/1.1 200 177.786171ms "crowdsec/1.0.9-2+b4-debian" "
Feb  4 08:47:00 Next crowdsec[3879183]: 127.0.0.1 - [Fri, 04 Feb 2022 08:47:00 CET] "POST /v1/alerts HTTP/1.1 201 35.639394ms "crowdsec/1.0.9-2+b4-debian" "
Feb  4 08:47:01 Next crowdsec[3879183]: 2022/02/04 08:47:01 Signal push response : http 200 OK
Feb  4 08:47:07 Next dhclient[614]: DHCPDISCOVER on eno1 to 255.255.255.255 port 67 interval 15
Feb  4 08:47:22 Next dhclient[614]: No DHCPOFFERS received.
Feb  4 08:47:22 Next dhclient[614]: No working leases in persistent database - sleeping.
Feb  4 08:47:52 Next systemd[1]: apache2.service: Main process exited, code=exited, status=1/FAILURE
Feb  4 08:47:52 Next systemd[1]: apache2.service: Killing process 2176407 (apache2) with signal SIGKILL.
Feb  4 08:47:52 Next systemd[1]: apache2.service: Killing process 2176455 (apache2) with signal SIGKILL.
Feb  4 08:47:52 Next systemd[1]: apache2.service: Killing process 2176517 (apache2) with signal SIGKILL.
Feb  4 08:47:52 Next systemd[1]: apache2.service: Killing process 2176519 (apache2) with signal SIGKILL.
Feb  4 08:47:52 Next systemd[1]: apache2.service: Killing process 2176521 (apache2) with signal SIGKILL.
Feb  4 08:47:52 Next systemd[1]: apache2.service: Killing process 2176408 (apache2) with signal SIGKILL.
Feb  4 08:47:52 Next systemd[1]: apache2.service: Killing process 2176456 (apache2) with signal SIGKILL.
Feb  4 08:47:52 Next systemd[1]: apache2.service: Killing process 2176518 (apache2) with signal SIGKILL.
Feb  4 08:47:52 Next systemd[1]: apache2.service: Killing process 2176520 (apache2) with signal SIGKILL.
Feb  4 08:47:52 Next systemd[1]: apache2.service: Killing process 2176522 (apache2) with signal SIGKILL.
Feb  4 08:47:52 Next systemd[1]: apache2.service: Failed with result 'exit-code'.

je ne comprends pas pourquoi cerbot s’est lancé a 8h44…
et surtout pourquoi ca bug !!!

j’ai trouve une alternative avec ca et un petit cron toutes les minutes mais j’aime pas bien…

#!/bin/bash
SERVICENAME="apache2"
systemctl is-active --quiet $SERVICENAME
STATUS=$? # return value is 0 if running
if [[ "$STATUS" -ne "0" ]]; then
        echo "Service '$SERVICENAME' is not curently running... Starting now..."
        service $SERVICENAME start
fi

Il faudrait nous montrer ce qu’il y a avant, là tu nous montres ce qui suit le redémarrage.

C’est ça qu’il faut étudier : le machin attend 15 secondes de voir venir une offre DHCP puis sleepe 30 secondes en attendant encore (dernière chance ?) de voir arriver quelque chose (une adresse IP ? Un renouvellement de bail ? Autre ?) et comme rien ne vient, abort.

Ton problème est dors et déjà identifié, c’est le script de redémarrage de apache durant le recheck du certificat qui te fait planté apache, maintenant pour la partie réseau ta configuration réseau semble par contre poser souci, si ta configuration se fait correctement en statique il ne devrait pas y avoir de demande dhcp pour renouveler le lease.

encore la meme chose ce matin…

/etc/init.d/apache2 status
● apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Fri 2022-02-25 00:00:05 CET; 7h ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 3257405 ExecReload=/usr/sbin/apachectl graceful (code=exited, status=0/SUCCESS)
   Main PID: 337903 (code=exited, status=1/FAILURE)
        CPU: 3h 44min 42.549s

févr. 24 00:00:01 Next systemd[1]: Reloading The Apache HTTP Server.
févr. 24 00:00:01 Next systemd[1]: Reloaded The Apache HTTP Server.
févr. 25 00:00:01 Next systemd[1]: Reloading The Apache HTTP Server.
févr. 25 00:00:01 Next systemd[1]: Reloaded The Apache HTTP Server.
févr. 25 00:00:05 Next systemd[1]: apache2.service: Main process exited, code=exited, status=1/FAILURE
févr. 25 00:00:05 Next systemd[1]: apache2.service: Killing process 3253264 (apache2) with signal SIGKILL.
févr. 25 00:00:05 Next systemd[1]: apache2.service: Killing process 3253264 (apache2) with signal SIGKILL.
févr. 25 00:00:05 Next systemd[1]: apache2.service: Failed with result 'exit-code'.
févr. 25 00:00:05 Next systemd[1]: apache2.service: Unit process 3253264 (apache2) remains running after unit stopped.
févr. 25 00:00:05 Next systemd[1]: apache2.service: Consumed 3h 44min 42.511s CPU time.

Mon syslog…

Feb 25 00:00:04 Next snort[3258543]: Commencing packet processing (pid=3258543)
Feb 25 00:00:04 Next systemd[1]: logrotate.service: Main process exited, code=exited, status=1/FAILURE
Feb 25 00:00:04 Next systemd[1]: logrotate.service: Failed with result 'exit-code'.
Feb 25 00:00:04 Next systemd[1]: Failed to start Rotate log files.
Feb 25 00:00:04 Next systemd[1]: logrotate.service: Consumed 1.235s CPU time.
Feb 25 00:00:05 Next systemd[1]: apache2.service: Main process exited, code=exited, status=1/FAILURE
Feb 25 00:00:05 Next systemd[1]: apache2.service: Killing process 3253264 (apache2) with signal SIGKILL.
Feb 25 00:00:05 Next systemd[1]: apache2.service: Killing process 3253264 (apache2) with signal SIGKILL.
Feb 25 00:00:05 Next systemd[1]: apache2.service: Failed with result 'exit-code'.
Feb 25 00:00:05 Next systemd[1]: apache2.service: Unit process 3253264 (apache2) remains running after unit stopped.
Feb 25 00:00:05 Next systemd[1]: apache2.service: Consumed 3h 44min 42.511s CPU time.

j’ai vu une erreur dans mon hosts… il y avait un virgule dans mon" ,127.0.0.1 localhost"
je ne sais pas si ça a un rapport…

Ca peut car je crois que Apache va utiliser le /etc/hosts pour bind son processus.