아파치 및 systemctl 상태

아파치 및 systemctl 상태

우리 회사에서는 SUSE Linux Enterprise를 사용합니다.
이제 우리는 첫 번째 SLES 12 머신을 갖게 되었습니다(이것은 systemd가 사용되는 SLES의 첫 번째 버전입니다).

누군가 "시작", "중지" 및 "다시 시작"이 작동하지만 "상태"는 더 이상 다루지 않는다고 말하는 링크를 찾았습니다.

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

-- ExecStatus처럼요?
아니요, 없습니다. 가장 좋은 방법은 독립적인 도구를 제공하는 것입니다. 왜냐하면 이를 systemd 자체에 통합할 필요가 거의 없기 때문입니다.

그래서 이 사람은 "systemctl status someservice"는 더 이상 다루지 않으므로 다른 도구를 사용해야 한다고 말하는 것 같습니다.

그러나 를 입력하면 systemctl status apache2작동합니다.

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

"systemclt status apache"가 계속 작동하도록 하려면 어떻게 해야 합니까?

답변1

systemd에는 기본적인 작업을 처리하는 다양한 모니터 유형이 있습니다. 일반적인 것은 "systemd에 의해 시작된 프로세스가 여전히 실행 중입니다"입니다. 이는 구성 데이터, 로그 줄 등과 함께 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.

systemd가 처리하지 못하는 것은 복잡한 것입니다("내 응용 프로그램이 데이터베이스와 통신하여 좋은 결과를 제공할 수 있습니까?"). 전통적인 init 스크립트를 사용하면 'status' 호출로 거의 모든 작업을 수행할 수 있습니다. systemd를 사용하면 내장된 작업으로 제한됩니다.

관련 정보