13장. systemctl을 사용하여 시스템 서비스 관리
시스템 관리자는 시스템 서비스를 관리하고 시작, 중지, 재시작, 활성화 및 비활성화, 서비스 나열 및 시스템 서비스 상태 표시와 같은 다양한 서비스와 관련된 다양한 작업을 수행하려고 합니다. systemd
시스템 및 서비스 관리자와 상호 작용하려면 systemctl
유틸리티를 사용합니다.
13.1. 시스템 서비스 나열
현재 로드된 모든 서비스 유닛과 사용 가능한 모든 서비스 유닛의 상태를 나열할 수 있습니다.
절차
현재 로드된 서비스 유닛을 모두 나열하려면 다음을 입력합니다.
$ systemctl list-units --type service UNIT LOAD ACTIVE SUB DESCRIPTION abrt-ccpp.service loaded active exited Install ABRT coredump hook abrt-oops.service loaded active running ABRT kernel log watcher abrtd.service loaded active running ABRT Automated Bug Reporting Tool ---- systemd-vconsole-setup.service loaded active exited Setup Virtual Console tog-pegasus.service loaded active running OpenPegasus CIM Server LOAD = Reflects whether the unit definition was properly loaded. ACTIVE = The high-level unit activation state, i.e. generalization of SUB. SUB = The low-level unit activation state, values depend on unit type. 46 loaded units listed. Pass --all to see loaded but inactive units, too. To show all installed unit files use 'systemctl list-unit-files'
기본적으로
systemctl list-units
명령은 활성 유닛만 표시합니다. 각 서비스 유닛 파일에 대해 명령은 다음을 표시합니다.-
UNIT
: 전체 이름 -
LOAD
: 유닛 파일이 로드되었는지 여부 -
SUB
또는SUB
: 높은 수준의 낮은 수준의 장치 파일 활성화 상태 -
설명
: 간단한 설명
-
상태에 관계없이 로드된 유닛을 모두 나열하려면
--all
또는-a
명령줄 옵션을 사용하여 다음 명령을 입력합니다.$ systemctl list-units --type service --all
사용 가능한 모든 서비스 단위의 상태(활성화 또는 비활성화)를 나열하려면 다음을 입력합니다.
$ systemctl list-unit-files --type service UNIT FILE STATE abrt-ccpp.service enabled abrt-oops.service enabled abrtd.service enabled ... wpa_supplicant.service disabled ypbind.service disabled 208 unit files listed.
각 서비스 유닛에 대해 이 명령은 다음을 표시합니다.
-
파일
이름 : 전체 이름 -
STATE
: 서비스 유닛이 활성화 또는 비활성화되었는지 여부
-
추가 리소스