Dynamic-Mess.com


"The world is a dynamic mess of jiggling things..."

Connaitre le statut d'un service

Article posté le 07-05-2015 dans la catégorie Linux

Article mis à jour le : 05-05-2022

Comment connaître le statut d'un service sous Linux

Utile par exemple quand un service ne démarre pas, vous pouvez utiliser la commande service <nom du service> status afin d'en savoir plus. Un exemple ci-dessous avec Apache:

root@monsiteweb:~$ service apache2 status
€— apache2.service - LSB: Apache2 web server
   Loaded: loaded (/etc/init.d/apache2)
   Active: failed (Result: exit-code) since jeu. 2017-05-04 16:49:53 CEST; 35s ago
  Process: 504 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILURE)
mai 04 16:49:53 monsiteweb apache2[504]: Starting web server: apache2 failed!
mai 04 16:49:53 monsiteweb apache2[504]: The apache2 configtest failed. ... (warning).
mai 04 16:49:53 monsiteweb apache2[504]: Output of config test was:
mai 04 16:49:53 monsiteweb apache2[504]: apache2: Syntax error on line 219 of /etc/apache2/apache2.conf: Could not open configuration file /etc/apache2/sites-enabled/eric.conf: No such file or directory
mai 04 16:49:53 monsiteweb apache2[504]: Action 'configtest' failed.
mai 04 16:49:53 monsiteweb apache2[504]: The Apache error log may have more information.
mai 04 16:49:53 monsiteweb systemd[1]: apache2.service: control process exited, code=exited status=1
mai 04 16:49:53 monsiteweb systemd[1]: Failed to start LSB: Apache2 web server.
mai 04 16:49:53 monsiteweb systemd[1]: Unit apache2.service entered failed state.

Dans cet exemple, on peut voir qu'il y a un problème avec le fichier de configuration eric.conf.


Cet article vous a plu? Découvrez d'autres articles :


comments powered by Disqus