서비스가 시작되지 않는 경우 데비안에서 서비스를 디버깅하는 방법

서비스가 시작되지 않는 경우 데비안에서 서비스를 디버깅하는 방법

나는 apache2가 포함된 새로운 데비안 불안정 기반 배포판을 가지고 있습니다. Apache 자체는 잘 작동합니다. 내가 사용한다면

sudo service apache2 start 

그것이 나타나고 모든 것이 잘됩니다.

그러나 이에 대한 서비스는 부팅할 때마다 시작되지 않습니다.

여기서 오류를 추적하는 방법은 무엇입니까?

etc/log/apache2/error.log:

[Sun Jan 15 14:51:06.685936 2017] [mpm_prefork:notice] [pid 2208] AH00169: caught SIGTERM, shutting down
[Sun Jan 15 14:51:47.842447 2017] [mpm_prefork:notice] [pid 2200] AH00163: Apache/2.4.23 (Debian) configured -- resuming normal operations
[Sun Jan 15 14:51:48.145808 2017] [core:notice] [pid 2200] AH00094: Command line: '/usr/sbin/apache2'
[Sun Jan 15 14:55:25.766188 2017] [mpm_prefork:notice] [pid 3257] AH00163: Apache/2.4.23 (Debian) configured -- resuming normal operations
[Sun Jan 15 14:55:25.801736 2017] [core:notice] [pid 3257] AH00094: Command line: '/usr/sbin/apache2'
[Sun Jan 15 16:08:15.031691 2017] [mpm_prefork:notice] [pid 2316] AH00163: Apache/2.4.23 (Debian) configured -- resuming normal operations
[Sun Jan 15 16:08:15.043756 2017] [core:notice] [pid 2316] AH00094: Command line: '/usr/sbin/apache2'
[Mon Jan 16 11:26:33.007967 2017] [mpm_prefork:notice] [pid 2278] AH00163: Apache/2.4.23 (Debian) configured -- resuming normal operations
[Mon Jan 16 11:26:33.013972 2017] [core:notice] [pid 2278] AH00094: Command line: '/usr/sbin/apache2'
 [Tue Jan 17 08:07:35.149382 2017] [mpm_prefork:notice] [pid 3517] AH00163: Apache/2.4.23 (Debian) configured -- resuming normal operations
 [Tue Jan 17 08:07:35.152372 2017] [core:notice] [pid 3517] AH00094: Command line: '/usr/sbin/apache2'

서비스 오류를 디버깅하는 데 도움이 되는 다른 파일은 무엇입니까?

답변1

  1. 실행으로 활성화된 서비스를 확인하세요.systemctl --no-page -t service -a | grep apache2
  2. 비활성화된 경우 활성화하고 시작합니다.systemctl enable apache2 && systemctl start apache2
  3. 서비스가 작동하는지 확인하세요.systemctl status apache2
  4. 필요한 경우 다음을 사용하여 apache2.service 관련 로그를 확인할 수 있습니다.journalctl --no-page -u apache2.service 메모. -f키는 다음 journalctl과 같이 작동합니다.tail

답변2

시스템이 설계된 대로 작동하는 데 오류가 없습니다. 아마도 당신이해야 할 것 같습니다~할 수 있게 하다서비스가 부팅 시 시작되도록 합니다.

systemctl enable service

systemctl/systemd 문서를 살펴보는 데 시간을 할애할 수도 있습니다.

관련 정보