리눅스

실행 중인 서비스와 설치된 모든 서비스 목록을 얻는 방법

변군이글루 2014. 7. 23. 16:22
반응형

실행 중인 서비스와 설치된 모든 서비스 목록을 얻는 방법

모든 서비스 목록 보기

시스템에 설치된 모든 서비스의 목록을 확인합니다.

시스템에 설치된 모든 서비스 유닛 파일을 나열하며 각 서비스의 상태(예: enabled, disabled, static 등)도 함께 보여줍니다.

systemctl list-unit-files --type=service

systemctl_list

실행 중인 서비스 목록 보기

현재 실행 중인 서비스만 나열합니다.

systemctl list-units --type=service --state=running

systemctl_list

  • LOAD → 유닛 정의가 제대로 로드되었는지를 나타냅니다.
  • ACTIVE → 유닛의 고수준 활성화 상태를 나타내며, SUB의 일반화된 형태입니다.
  • SUB → 유닛의 저수준 활성화 상태를 나타내며, 값은 유닛 유형에 따라 다릅니다.

서비스 상태별 필터링

systemctl 명령어에는 다양한 상태별로 필터링할 수 있는 옵션이 있습니다.

 

활성화된 서비스

systemctl list-units --type=service --state=active

비활성화된 서비스

systemctl list-unit-files --type=service | grep disabled

실패한 서비스

systemctl --failed

특정 서비스 검색

특정 서비스와 관련된 정보를 검색하려면 grep을 사용하여 필터링할 수 있습니다.

systemctl list-unit-files --type=service | grep nginx

서비스 상태 확인

특정 서비스의 상태를 확인합니다.

systemctl status <service_name>
systemctl status nginx

서비스 활성화 및 비활성화

서비스 활성화

sudo systemctl enable <service_name>

서비스 비활성화

sudo systemctl disable <service_name>

전체 시스템 서비스 상태 요약

시스템의 모든 서비스의 요약 상태를 확인합니다.

systemctl

 

systemd에서 관리하는 서비스 목록을 효과적으로 관리하고 모니터링할 수 있습니다.

 

참고URL

- ubuntu manpages : systemd

 

728x90
반응형