Systemctl
Query or send control commands to the system manager.
Categories
Unit Commands
-
list-units [PATTERN...]: List units currently in memory -
list-sockets [PATTERN...]: List socket units currently in memory, ordered by address -
list-timers [PATTERN...]: List timer units currently in memory, ordered by next elapse -
start UNIT...: Start (activate) one or more units -
stop UNIT...: Stop (deactivate) one or more units -
reload UNIT...: Reload one or more units -
restart UNIT...: Start or restart one or more units -
try-restart UNIT...: Restart one or more units if active -
reload-or-restart UNIT...: Reload one or more units if possible, otherwise start or restart -
try-reload-or-restart UNIT...: If active, reload one or more units, if supported, otherwise restart -
isolate UNIT: Start one unit and stop all others -
kill UNIT...: Send signal to processes of a unit -
clean UNIT...: Clean runtime, cache, state, logs or configuration of unit -
freeze PATTERN...: Freeze execution of unit processes -
thaw PATTERN...: Resume execution of a frozen unit -
is-active PATTERN...: Check whether units are active -
is-failed PATTERN...: Check whether units are failed -
status [PATTERN...|PID...]: Show runtime status of one or more units -
show [PATTERN...|JOB...]: Show properties of one or more units/jobs or the manager -
cat PATTERN...: Show files and drop-ins of specified units -
set-property UNIT PROPERTY=VALUE...: Sets one or more properties of a unit -
help PATTERN...|PID...: Show manual for one or more units -
reset-failed [PATTERN...]: Reset failed state for all, one, or more units -
list-dependencies [UNIT...]: Recursively show units which are required or wanted by the units or by which those units are required or wanted
Unit File Commands
-
list-unit-files [PATTERN...]: List installed unit files -
enable [UNIT...|PATH...]: Enable one or more unit files -
disable UNIT...: Disable one or more unit files -
reenable UNIT...: Reenable one or more unit files -
preset UNIT...: Enable/disable one or more unit files based on preset configuration -
preset-all: Enable/disable all unit files based on preset configuration -
is-enabled UNIT...: Check whether unit files are enabled -
mask UNIT...: Mask one or more units -
unmask UNIT...: Unmask one or more units -
link PATH...: Link one or more units files into the search path -
revert UNIT...: Revert one or more unit files to vendor version -
add-wants TARGET UNIT...: Add 'Wants' dependency for the target on specified one or more units -
add-requires TARGET UNIT...: Add 'Requires' dependency for the target on specified one or more units -
edit UNIT...: Edit one or more unit files -
get-default: Get the name of the default target -
set-default TARGET: Set the default target
Machine Commands
-
list-machines [PATTERN...]: List local containers and host
Job Commands
-
list-jobs [PATTERN...]: List jobs -
cancel [JOB...]: Cancel all, one, or more jobs
Environment Commands
-
show-environment: Dump environment -
set-environment VARIABLE=VALUE...: Set one or more environment variables -
unset-environment VARIABLE...: Unset one or more environment variables -
import-environment [VARIABLE...]: Import all or some environment variables
Manager State Commands
-
daemon-reload: Reload systemd manager configuration -
daemon-reexec: Reexecute systemd manager -
log-level [LEVEL]: Get/set logging threshold for manager -
log-target [TARGET]: Get/set logging target for manager -
service-watchdogs [BOOL]: Get/set service watchdog state
System Commands
-
is-system-running: Check whether system is fully running -
default: Enter system default mode -
rescue: Enter system rescue mode -
emergency: Enter system emergency mode -
halt: Shut down and halt the system -
poweroff: Shut down and power-off the system -
reboot: Shut down and reboot the system -
kexec: Shut down and reboot the system with kexec -
exit [EXIT_CODE]: Request user instance or container exit -
switch-root ROOT [INIT]: Change to a different root file system -
suspend: Suspend the system -
hibernate: Hibernate the system -
hybrid-sleep: Hibernate and suspend the system -
suspend-then-hibernate: Suspend the system, wake after a period of time, and hibernate
Examples
-
systemctl list-unit-files - 유닛 파일 목록 출력.
-
systemctl list-units - 유닛 목록 출력.
-
systemctl list-units --type=target - 활성화된 타겟 유닛 목록 출력.
-
systemctl list-units --type=target --all - 전체 타겟 유닛 목록 출력.
-
systemctl list-units --state=active - 모든 active 목록
-
systemctl list-units --type=service --state=running - 서비스중에 상태가 running 인 목록
-
systemctl stop [service] - 서비스 정지.
-
systemctl start [service] - 서비스 시작.
-
systemctl restart [service] - 서비스 재시작.
-
systemctl reload [service] - 서비스 갱신.
-
systemctl status [service] - List status of service
-
systemctl enable [service] - 부팅 시 자동 실행 하기
-
systemctl is-enabled [service] - 활성화 상태 확인
-
systemctl isolate runlevel<NUM>.target - 현재의 RUN LEVEL을 변경한다.
-
systemctl isolate graphical.target - 현재의 RUN LEVEL을 Graphical로 변경한다.
-
systemctl set-default graphical.target - 기본 RUN LEVEL을 Graphical로 변경한다. (부팅시 자동 적용된다)
See also
- sysz - A fzf terminal UI for systemctl