- 工信部備案號 滇ICP備05000110號-1
- 滇公安備案 滇53010302000111
- 增值電信業(yè)務經營許可證 B1.B2-20181647、滇B1.B2-20190004
- 云南互聯(lián)網協(xié)會理事單位
- 安全聯(lián)盟認證網站身份V標記
- 域名注冊服務機構許可:滇D3-20230001
- 代理域名注冊服務機構:新網數(shù)碼
Systemctl是一個systemd工具,主要負責控制systemd系統(tǒng)和服務管理器。
Systemd是一個系統(tǒng)管理守護進程、工具和庫的集合,用于取代System V初始進程。Systemd的功能是用于集中管理和配置類UNIX系統(tǒng)。
在Linux生態(tài)系統(tǒng)中,Systemd被部署到了大多數(shù)的標準Linux發(fā)行版中,只有為數(shù)不多的幾個發(fā)行版尚未部署。Systemd通常是所有其它守護進程的父進程,但并非總是如此。
使用Systemctl?理Linux服務
本文旨在闡明在運行systemd的系統(tǒng)上“如何控制系統(tǒng)和服務”。
# systemd --version systemd 215 +PAM +AUDIT +SELINUX +IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ -SECCOMP -APPARMOR
上例中很清楚地表明,我們安裝了215版本的systemd。
# whereis systemd systemd:/usr/lib/systemd /etc/systemd /usr/share/systemd /usr/share/man/man1/systemd.1.gz # whereis systemctl systemctl:/usr/bin/systemctl /usr/share/man/man1/systemctl.1.gz
# ps -eaf | grep [s]ystemd root 10016:27?00:00:00/usr/lib/systemd/systemd --switched-root --system --deserialize23 root 4441016:27?00:00:00/usr/lib/systemd/systemd-journald root 4691016:27?00:00:00/usr/lib/systemd/systemd-udevd root 5551016:27?00:00:00/usr/lib/systemd/systemd-logind dbus 5561016:27?00:00:00/bin/dbus-daemon --system --address=systemd:--nofork --nopidfile --systemd-activation
注意:systemd是作為父進程(PID=1)運行的。在上面帶(-e)參數(shù)的ps命令輸出中,選擇所有進程,(-a)選擇除會話前導外的所有進程,并使用(-f)參數(shù)輸出完整格式列表(即 -eaf)。
也請注意上例中后隨的方括號和例子中剩余部分。方括號?達式是grep的字符類表達式的一部分。
# systemd-analyze Startup finished in487ms(kernel)+2.776s(initrd)+20.229s(userspace)=23.493s
# systemd-analyze blame 8.565s mariadb.service 7.991s webmin.service 6.095s postfix.service 4.311s httpd.service 3.926s firewalld.service 3.780s kdump.service 3.238s tuned.service 1.712s network.service 1.394s lvm2-monitor.service 1.126s systemd-logind.service ....
# systemd-analyze critical-chain The time after the unit is active or started is printed after the "@" character. The time the unit takes to start is printed after the "+" character. multi-user.target @20.222s └─mariadb.service @11.657s+8.565s └─network.target @11.168s └─network.service @9.456s+1.712s └─NetworkManager.service @8.858s+596ms └─firewalld.service @4.931s+3.926s └─basic.target @4.916s └─sockets.target @4.916s └─dbus.socket @4.916s └─sysinit.target @4.905s └─systemd-update-utmp.service @4.864s+39ms └─auditd.service @4.563s+301ms └─systemd-tmpfiles-setup.service @4.485s+69ms └─rhel-import-state.service @4.342s+142ms └─local-fs.target @4.324s └─boot.mount @4.286s+31ms └─systemd-fsck@dev-disk-byx2duuid-79f594adx2da332x2d4730x2dbb5fx2d85d19608096 └─dev-disk-byx2duuid-79f594adx2da332x2d4730x2dbb5fx2d85d196080964.device@4
售前咨詢
售后咨詢
備案咨詢
二維碼
TOP