estado de apache y systemctl

estado de apache y systemctl

Utilizamos SUSE Linux Enterprise en nuestra empresa.
Ahora tenemos nuestra primera máquina SLES 12 (esta es la primera versión en SLES que se utiliza systemd).

Encontré un enlace donde alguien dice que "iniciar", "detener" y "reiniciar" están funcionando, pero el "estado" ya no se trata.

http://comments.gmane.org/gmane.comp.sysutils.systemd.devel/3050

- ¿Te gusta ExecStatus?
No, no lo hay. Para eso, lo mejor es simplemente proporcionar una herramienta independiente, ya que hay poca necesidad real de integrarla en el propio systemd.

Entonces este tipo parece decir que "systemctl status someservice" ya no está cubierto, por lo que debes usar otra herramienta.

Pero luego, si entro systemctl status apache2, funciona:

systemctl status apache2
apache2.service - The Apache Webserver
   Loaded: loaded (/usr/lib/systemd/system/apache2.service; disabled)
   Active: inactive (dead)

¿Cómo lograron seguir teniendo un "apache de estado de systemclt" en funcionamiento?

Respuesta1

systemd tiene varios tipos de monitores que manejan cosas básicas. Una pregunta común es "¿el proceso iniciado por systemd todavía se está ejecutando?". Esto, junto con los datos de configuración, líneas de registro, etc., son el tipo de información que reporta systemctl.

$ systemctl status httpd
* httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2016-06-03 09:27:28 EDT; 2 weeks 3 days ago
     Docs: man:httpd(8)
           man:apachectl(8)
  Process: 484 ExecReload=/usr/sbin/httpd $OPTIONS -k graceful (code=exited, status=0/SUCCESS)
 Main PID: 784 (httpd)
   Status: "Total requests: 0; Current requests/sec: 0; Current traffic:   0 B/sec"
   CGroup: /system.slice/httpd.service
           |- 532 /usr/sbin/httpd -DFOREGROUND
           |- 533 /usr/sbin/httpd -DFOREGROUND
           |- 534 /usr/sbin/httpd -DFOREGROUND
           |- 535 /usr/sbin/httpd -DFOREGROUND
           |- 536 /usr/sbin/httpd -DFOREGROUND
           |- 784 /usr/sbin/httpd -DFOREGROUND
           `-2677 /usr/sbin/httpd -DFOREGROUND

Jun 17 03:49:13 SERVER systemd[1]: Reloaded The Apache HTTP Server.
Jun 19 03:17:03 SERVER systemd[1]: Reloaded The Apache HTTP Server.
Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
Hint: Some lines were ellipsized, use -l to show in full.

Lo que systemd no maneja son cosas complicadas ("¿puede mi aplicación comunicarse con la base de datos y proporcionar buenos resultados?"). Con los scripts de inicio tradicionales, la llamada de "estado" podría hacer casi cualquier cosa. Con systemd está limitado a las tareas integradas.

información relacionada