SYSTEMD(1) systemd SYSTEMD(1) (NAME) systemd, init - (SYNOPSIS) /usr/lib/systemd/systemd [OPTIONS...] init [OPTIONS...] {COMMAND} (DESCRIPTION) systemd . ( PID 1) init (userspace) . . systemd /sbin/init . user@.service(5) . SysV init (PID ) telinit . init telinit . telinit(8) . systemd system.conf system.conf.d user.conf user.conf.d . systemd-system.conf(5) . systemd . (hostname) loopback . API /sys/ /proc/ /dev/ (mount) . systemd . << >> . systemd ( ) [1] . D-Bus systemd org.freedesktop.systemd1(5) org.freedesktop.LogControl1(5) . systemd initrd [2] initrd[3] . (UNITS) systemd <<>> (units) . . systemd.unit(5) . . . &1. & (ACTIVE) +----------------+--------------------------------------------+ | | | +----------------+--------------------------------------------+ |active | | | | (bound) | | | (plugged in) | | | ... | | | . | +----------------+--------------------------------------------+ |inactive | | | | (unbound) | | | (unplugged) ... | | | | | | . | +----------------+--------------------------------------------+ |failed | inactive | | | | | | | | | ( | | | | | | | | | | | | | | | | | | | | | | | | | | | ). | +----------------+--------------------------------------------+ |activating | | | | inactive active. | +----------------+--------------------------------------------+ |deactivating | | | | active inactive. | +----------------+--------------------------------------------+ |maintenance | inactive | | | | | | | | | . | +----------------+--------------------------------------------+ |reloading | active | | | | | | | | | . | +----------------+--------------------------------------------+ |refreshing | active | | | | | | (namespace) | | | . | +----------------+--------------------------------------------+ : 1. (Service units) . systemd.service(5). 2. (Socket units) IPC . systemd.socket(5) daemon(7) . 3. (Target units) systemd.target(5). 4. (Device units) systemd . systemd.device(5). 5. (Mount units) systemd.mount(5). 6. - (Automount units) - . systemd.automount(5). 7. (Timer units) . systemd.timer(5) . 8. (Swap units) () . systemd.swap(5) . 9. (Path units) . systemd.path(5). 10. (Slice units) ( service scope) . systemd.slice(5). 11. (Scope units) . systemd.scope(5). . . systemd.special(7) . systemd ( Requires= Conflicts=) (After= Before=). : ( ) . ( foo.service bar.service ) ( foo.service bar.service ) . . systemd . . ( ) . systemd <<>> ('jobs') . . systemd default.target . ( ) graphical.target ( ) multi-user.target ( graphical.target) . . systemd.special(7) . systemd (preset) . systemd.preset(5) << >> machine-id(5). systemd . : 1. active activating deactivating failed ( "inactive") 2. 3. 4. ( ) 5. D-Bus systemd -- -- . . systemctl list-units --all . . (accounting) . . systemd (control groups) systemd . ( "cgroups" (Control Groups v2)[4] ). systemd . ( /sys/fs/cgroup/) systemd-cgls(1) ps(1) ( ps xawf -eo pid,user,cgroup,args systemd ). systemd SysV init : SysV init ( ) . SysV /dev/initctl SysV . /etc/fstab utmp . systemd : . ( ). systemd . systemd . . . systemd . ( ). . . . systemd.generator(7). (DIRECTORIES) systemd . pkg-config systemd --variable=systemdsystemunitdir . /usr/local/lib/systemd/system /usr/lib/systemd/system. . pkg-config systemd --variable=systemdsystemconfdir . enable disable systemctl(1) . systemd.unit(5) . . XDG (XDG Base Directory specification)[5] . pkg-config systemd --variable=systemduserunitdir . pkg-config systemd --variable=systemduserconfdir . enable disable systemctl(1) / ( ) ( ) . systemd.unit(5) . SysV init SysV init . systemd SysV init ( .service) . SysV (link farm) SysV . systemd . SysV . (SIGNALS) . . . sd_notify() X_SYSTEMD_SIGNALS_LEVEL=2 . . SIGTERM systemd . systemctl daemon-reexec . systemd exit.target . systemctl --user start exit.target --job-mode=replace-irreversibly . SIGINT systemd ctrl-alt-del.target . systemctl start ctrl-alt-del.target --job-mode=replace-irreversibly . (reboot) . Ctrl+Alt+Del . Ctrl+Alt+Del . systemd SIGTERM . SIGWINCH systemd kbrequest.target . systemctl start kbrequest.target . systemd . SIGPWR systemd sigpwr.target . systemctl start sigpwr.target . SIGUSR1 systemd D-Bus . SIGUSR2 systemd . systemd-analyze dump . SIGHUP . systemctl daemon-reload . SIGRTMIN+0 default.target . systemctl isolate default.target . SIGRTMIN+1 (rescue) rescue.target . systemctl isolate rescue.target . SIGRTMIN+2 (emergency) emergency.service . systemctl isolate emergency.service . SIGRTMIN+3 (halt) halt.target . systemctl start halt.target --job-mode=replace-irreversibly . SIGRTMIN+4 (power off) poweroff.target . systemctl start poweroff.target --job-mode=replace-irreversibly . SIGRTMIN+5 (reboot) reboot.target . systemctl start reboot.target --job-mode=replace-irreversibly . SIGRTMIN+6 kexec kexec.target . systemctl start kexec.target --job-mode=replace-irreversibly . SIGRTMIN+7 soft-reboot.target . systemctl start soft-reboot.target --job-mode=replace-irreversibly . 254. SIGRTMIN+13 (halt) . SIGRTMIN+14 (power off) . SIGRTMIN+15 (reboot) . SIGRTMIN+16 kexec . SIGRTMIN+17 . 254. SIGRTMIN+20 systemd.show_status=1 . SetShowStatus() SIGRTMIN+20 (race conditions) . org.freedesktop.systemd1(5). SIGRTMIN+21 systemd.show_status=0 . SetShowStatus() SIGRTMIN+21 . org.freedesktop.systemd1(5). SIGRTMIN+22 "debug" systemd.log_level=debug . SIGRTMIN+23 . - - systemd.log-level= LogLevel= "info" . 239. SIGRTMIN+24 ( --user ). 195. SIGRTMIN+25 systemd . systemctl daemon-reexec . systemd SIGTERM . 250. SIGRTMIN+26 (log target) . - - systemd.log-target= LogTarget= . 239. SIGRTMIN+27, SIGRTMIN+28 "console" SIGRTMIN+27 ( "kmsg" SIGRTMIN+28) systemd.log_target=console ( systemd.log_target=kmsg SIGRTMIN+28) . 239. (ENVIRONMENT) . ( "key=value" PID 1 ). << >> systemd.exec(5) . DefaultEnvironment= user@.service . ( ) Environment= EnvironmentFile= user@.service ( systemd.exec(5)). ManagerEnvironment= systemd- system.conf(5) systemd-user.conf(5) . systemd: $SYSTEMD_LOG_LEVEL ( ). . ( ) : emerg alert crit err warning notice info debug 0...7. syslog(3) . console syslog kmsg journal ( SYSTEMD_LOG_LEVEL=debug,console:info debug info ). . --log-level= . $SYSTEMD_LOG_COLOR (boolean). true tty . --log-color= . $SYSTEMD_LOG_TIME . true (timestamp) . --log-time= . 246. $SYSTEMD_LOG_LOCATION . true . --log-location= . $SYSTEMD_LOG_TID . true (TID) . 247. $SYSTEMD_LOG_TARGET . : console ( tty ) console-prefixed ( tty "facility" syslog(3)) kmsg ( ) journal ( ) journal-or-kmsg ( kmsg) auto ( ) null ( ). --log-target= . $SYSTEMD_LOG_RATELIMIT_KMSG (ratelimit) kmsg . . "true" . systemd kmsg . 254. $XDG_CONFIG_HOME, $XDG_CONFIG_DIRS, $XDG_DATA_HOME, $XDG_DATA_DIRS systemd XDG (XDG Base Directory specification)[5] . $SYSTEMD_UNIT_PATH, $SYSTEMD_GENERATOR_PATH, $SYSTEMD_ENVIRONMENT_GENERATOR_PATH systemd (generators) . (":") . ("...:") . . $SYSTEMD_PAGER, $PAGER (pager) --no-pager . $SYSTEMD_PAGER $PAGER . $SYSTEMD_PAGER $PAGER less(1) more(1) . . "cat" --no-pager . : $SYSTEMD_PAGERSECURE $SYSTEMD_PAGER $PAGER ( "cat" "") . $SYSTEMD_LESS less ( "FRSXMK"). : K Ctrl+C . less Ctrl+C . $SYSTEMD_LESS "K" less Ctrl+C . X termcap . . . $LESS less systemd . less(1) . $SYSTEMD_LESSCHARSET (charset) less ( "utf-8" UTF-8 ). $LESSCHARSET less systemd . $SYSTEMD_PAGERSECURE less(1) <<>> . sudo(8) pkexec(1) . . << >> ( ). << >> --no-pager PAGER=cat . . true << >> . << >> LESSSECURE=1 . less(1) << >> . false . SYSTEMD_PAGERSECURE=0 . $SYSTEMD_PAGERSECURE systemd << >> . (effective UID) ( geteuid(2) sd_pid_get_owner_uid(3)) sudo(8) ($SUDO_UID [6]) << >> . SYSTEMD_PAGERSECURE=1 << >> . . $SYSTEMD_PAGERSECURE . $SYSTEMD_PAGER $PAGER ( ) $SYSTEMD_PAGERSECURE . $SYSTEMD_COLORS . true systemd (monochrome) . : "16" "256" ANSI . $TERM . $SYSTEMD_URLIFY . . systemd $TERM . $LISTEN_PID, $LISTEN_FDS, $LISTEN_FDNAMES systemd . sd_listen_fds(3) . $NOTIFY_SOCKET . . sd_notify(3) . systemd [7] . (KERNEL COMMAND LINE) systemd . systemd . systemd . /proc/cmdline EFI "SystemdOptions" ( EFI) . /proc/cmdline . : "SystemdOptions" . : systemd.unit=, rd.systemd.unit= . default.target . rescue.target emergency.service . systemd.special(7) . "rd." initrd . systemd.dump_core . systemd ( PID 1) (core dump) . . . 233. systemd.crash_chvt . . ( -) (PID 1) . . . 233. systemd.crash_shell . (PID 1) (shell) . . . 233. systemd.crash_action= "freeze" "reboot" "poweroff" . "freeze" . "freeze" (PID 1) . "reboot" (PID 1) . "poweroff" (PID 1) . systemd.crash_shell . 256. systemd.confirm_spawn . . (PID 1) /dev/console . ( "ttyS0") . . 233. systemd.service_watchdogs= . (WatchdogSec=) ( OnFailure= StartLimitAction=) (PID 1) systemd.service(5). . . 237. systemd.show_status error auto . . systemd (PID 1) . error . auto false . quiet error . ShowStatus= systemd-system.conf(5). 233. systemd.status_unit_format= name description combined . name . combined . StatusUnitFormat= systemd-system.conf(5). 243. systemd.log_color, systemd.log_level=, systemd.log_location, systemd.log_target=, systemd.log_time, systemd.log_tid, systemd.log_ratelimit_kmsg $SYSTEMD_LOG_COLOR $SYSTEMD_LOG_LEVEL $SYSTEMD_LOG_LOCATION $SYSTEMD_LOG_TARGET $SYSTEMD_LOG_TIME $SYSTEMD_LOG_TID $SYSTEMD_LOG_RATELIMIT_KMSG . systemd.log_color systemd.log_location systemd.log_time systemd.log_tid systemd.log_ratelimit_kmsg . systemd.default_standard_output=, systemd.default_standard_error= . StandardOutput= StandardError= ( systemd.exec(5) ). inherit null tty journal journal+console kmsg kmsg+console . systemd.default-standard-output= journal systemd.default-standard-error= inherit . systemd.setenv= VARIABLE=VALUE . . . systemd.machine_id= machine-id . . 229. systemd.set_credential=, systemd.set_credential_binary= ImportCredential= LoadCredential= systemd.exec(5) . . systemd.set_credential= systemd.set_credential_binary= Base64 . /proc/cmdline . . ( / ) / . [8] . 251. systemd.import_credentials= . false OEM DMI/SMBIOS qemu_fw_cfg EFI . 251. quiet systemd.show_status=no . . . 186. debug . systemd.log_level=debug . . . 205. emergency, rd.emergency, -b (emergency mode). systemd.unit=emergency.target rd.systemd.unit=emergency.target . 186. rescue, rd.rescue, single, s, S, 1 (rescue mode). systemd.unit=rescue.target rd.systemd.unit=rescue.target . 186. 2, 3, 4, 5 SysV. 2 3 4 systemd.unit=multi-user.target 5 systemd.unit=graphical.target . 186. locale.LANG=, locale.LANGUAGE=, locale.LC_CTYPE=, locale.LC_NUMERIC=, locale.LC_TIME=, locale.LC_COLLATE=, locale.LC_MONETARY=, locale.LC_MESSAGES=, locale.LC_PAPER=, locale.LC_NAME=, locale.LC_ADDRESS=, locale.LC_TELEPHONE=, locale.LC_MEASUREMENT=, locale.LC_IDENTIFICATION= (locale) . /etc/locale.conf . locale.conf(5) locale(7) . 186. kernel- command-line(7) . (SYSTEM CREDENTIALS) : o SMBIOS 11 io.systemd.credential:name=value io.systemd.credential.binary:name=value . o "fw_cfg" QEMU . ( SMBIOS ). o systemd.set-credential= . o UEFI systemd-stub(7) . o initrd -> host /run/credentials/@initrd/ . systemd-creds(1) : # systemd-creds --system list [8] . PID 1 : vmm.notify_socket AF_VSOCK AF_UNIX READY=1 . sd_notify(3) . SOCK_DGRAM AF_VSOCK SOCK_SEQPACKET . (payload) AF_VSOCK "vsock:CID:PORT" . "vsock-stream" "vsock-dgram" "vsock-seqpacket" "vsock" . VSOCK . 254. system.machine_id /etc/machine-id . machine- id(5) . 254. systemd systemd.system- credentials(7) . (READINESS PROTOCOL) ( ) ( ) . ( ) sd_notify(3) . ( PID 1) $NOTIFY_SOCKET ( ). : vmm.notify_socket ( ) ( AF_VSOCK) SMBIOS 11 . . . : o X_SYSTEMD_HOSTNAME=... . ( ) . 256. o X_SYSTEMD_MACHINE_ID=... . machine-id(5) . 256. o X_SYSTEMD_SIGNALS_LEVEL=... . . : o X_SYSTEMD_SIGNALS_LEVEL=2 - SysV init . PID 1 . . 2 . 256. o X_SYSTEMD_UNIT_ACTIVE=... X_SYSTEMD_UNIT_INACTIVE=... . . ssh-access.target SSH systemd.special(7) . 256. o X_SYSTEMD_SHUTDOWN=... . "reboot" "halt" "poweroff" "kexec" . 256. o X_SYSTEMD_REBOOT_PARAMETER=... . systemctl --reboot-argument=... . 256. "READY=1" "RELOADING=1" . (OPTIONS) systemd . systemctl(1) . systemd . (Introspection and debugging options) systemd : --dump-configuration-items . . --dump-bus-properties . D-Bus . 239. --test ( ) -- . . . --system ( ) --user . --system, --user --test . --test ( --test) PID . --system PID . -h, --help . --version . (Options that duplicate kernel command line settings) << >> . (namespaced) . . systemd . systemd user@.service(5) . ( systemd- user.conf(5)) . << >> . --unit= . default.target . systemd.unit= . --dump-core (core dump) . . systemd.dump_core= . --crash-vt=VT (VT) . . systemd.crash_chvt= ( !). 227. --crash-shell . . systemd.crash_shell= . --crash-action= (PID 1) . systemd . systemd.crash_action= . 256. --confirm-spawn . . systemd.confirm_spawn . --show-status . systemd.show_status . 244. --log-color . systemd.log_color . 244. --log-level= . systemd.log_level . --log-location . systemd.log_location . 244. --log-target= . systemd.log_target . --log-time= . systemd.log_time . 246. --machine-id= machine-id . systemd.machine_id= . 229. --service-watchdogs / . systemd.service_watchdogs . 237. --default-standard-output=, --default-standard-error= . systemd.default_standard_output= systemd.default_standard_error= . (SYSTEM CLOCK EPOCH) systemd <<>> (epoch) . (monotonic) (RTC) . . . ( ) . : systemd ("mtime") /usr/lib/clock-epoch /var/lib/systemd/timesync/clock. (FILES) /run/systemd/notify . AF_UNIX sd_notify(3) . /run/systemd/private systemctl(1) systemd . (stream) AF_UNIX . systemd . /dev/initctl SysV systemd-initctl.service . (named pipe) . . /usr/lib/clock-epoch ("mtime") (epoch) . 247. /var/lib/systemd/timesync/clock ("mtime") systemd-timesyncd.service(8) . . 257. (HISTORY) systemd 252 systemd.unified_cgroup_hierarchy systemd.legacy_systemd_cgroup_controller . cgroup . 252. (SEE ALSO) systemd[9] systemd-system.conf(5) locale.conf(5) systemctl(1) journalctl(1) systemd-notify(1) daemon(7) sd-daemon(3) org.freedesktop.systemd1(5) systemd.unit(5) systemd.special(7) pkg-config(1) kernel- command-line(7) bootup(7) systemd.directives(7) org.freedesktop.systemd1(5) systemd [10] . (NOTES) 1. (Interface Portability and Stability Promise) https://systemd.io/PORTABILITY_AND_STABILITY 2. (Container Interface) https://systemd.io/CONTAINER_INTERFACE 3. initrd (initrd Interface) https://systemd.io/INITRD_INTERFACE 4. (Control Groups v2) https://docs.kernel.org/admin-guide/cgroup-v2.html 5. XDG (XDG Base Directory specification) https://standards.freedesktop.org/basedir-spec/basedir-spec- latest.html 6. $SUDO_UID . 7. (Known Environment Variables) https://systemd.io/ENVIRONMENT 8. (System and Service Credentials) https://systemd.io/CREDENTIALS 9. systemd https://systemd.io 10. (Original Design Document) https://0pointer.de/blog/projects/systemd.html systemd 257.13 SYSTEMD(1)