男女疯狂一边摸一边做羞羞视频|啊好深好硬快点用力别停动态图|亚洲一区无码中文字幕|特级无码毛片免费视频播放▽|久久狠狠躁免费观看|国内精品久久久久久网站

Systemd ?????????? ??????????: ?????? ???

Systemd ???????? ??????????: ?????? ????? ???

Systemd ?????????? ??????????: ?????? ???

????: ?????? ???????

?????: ???? ????? ? ?????

Systemd ?? ??????? ????????? ???? ???, ?? ???? ???? ??????? ???? ?????????? ?????? ??? ???????? ??????? ??? ??????????? ????? ???????

?? ??????? ?? ????? ??????? ?????? ??? ??????, ?? ????? ??? ????? ????? ???? ??????? ?? ??? ?? ?????? ?????????? ???????? ????, ??????? ???? ??????? ???? ?????? ??????? ????? ?? ?????? ????? img

??. ???

???????, ????????? ???? ???? ????? ??? ?????? init ???????????

????? ???????? ??????? ???? ???? ???? ??????? ??? ????

?? ??????? ???? ??????? ???????

???? ?? ???? ???? ???? ?????? init ?????????????? ????????????? ???? ???, ????????? ?????????? ?????????? ??????? ??? ??????? ?????????? ???? ????

?????????, ????????? ???? ??? ????? init ?????????? ????????? ???????? ????????? ??????, ???? ???? ????? ?????? ??? ??? ????????????? ??????? ????????? ???????? ???? ???, ?? ???????? ????????????? ??? ????? ??? ?????

???, Systemd ?? ??????????

Systemd ?? ?????????? ???????? ???? ???? ??????? ?? ?????? ?????? ?? ????????? ???? ??? ???????????? ???? ???? ???????? ?????? ?????? ????

????????? ?????? ???????, ????? d ??? ???? (daemon) ?? ????????? ???? Systemd ?? ?????? ???? ??? ??? ???? ????????? ????? ?????

img

(????? ????? Systemd ??????) Lennart Poettering

Systemd ??????? ???? ?? ????? ??? init ???????? ??????????? ????? initd ????????? ????? ?????????? ???? ??? (PID ???? 1), ???? ?????????????? ?? ??????? ???????????

????? ???????? Systemd ?? ??????? ???????

Systemd 的優(yōu)點(diǎn)是功能強大,使用方便,缺點(diǎn)是體系龐大,非常復雜。事實(shí)上,現在還有很多人反對使用 Systemd,理由就是它過(guò)于復雜,與操作系統的其他部分強耦合,違反"keep simple, keep stupid"的 ??????? ????? img

(????? ??????? Systemd ???????? ?????)

???? ??????? ???????????

Systemd ???? ?????? ???, ??? ??? ???? ???????? ???, ?? ??????? ???????????? ??????? ????? ???? ??????????

3.1 systemctl

systemctl ??? Systemd ?? ?????? ??????, ?? ??????? ????????? ???? ??????? ????

3.2 systemd-analyze

systemd-analyze ????????? ???? ????? ???? ???????

3.3 hostnamectl

hostnamectl ??? ??????? ??????? ???? ????? ??????? ???????

3.4 localectl

localectl ????????????? ?????? ????? ???? ???????

3.5 timedatectl

timedatectl ??????? ???? ????? ?????? ????? ???????

3.6 loginctl

loginctl ??????? ?? ?? ??? ?????????????? ????? ???? ???????

???, ?????

?.? ????

Systemd ????? ??????? ????? ???????? ???? ????? ????? ????? ??????? ???????? ????? (Unit) ??? ????

????? ??? 12 ????? ???????

  • ??????? ?????: ??????? ???????
  • ?????? ?????: ?????? ??????? ???????? ???? ???? ?????
  • ?????? ?????: ???????????? ??????
  • ?????? ?????: ???? ????????? ?????? ???????
  • ????????? ?????:???????????? ?????? ???????
  • ?? ?????: ???? ?? ??
  • ????? ?????: ???????? ?????? ????? ??? ??? ?????? ??????????
  • Slice Unit: ?????????? ?????
  • ????????? ?????: ???????? ?????????, ???? ?????????? ???? ?????? ?????
  • ???? ?????: ??????????? ????? ????????? ????
  • ??????? ?????: ??????? ????
  • ?????? ?????:??????

systemctl list-units ?????? ??????? ????????? ?? ????? ????? ?????

?.? ??????? ??????

systemctl status ???????? ????????? ?????? ??? ???? ??? ??????? ?????? ????? ??????? ????

???? status ????, systemctl ??????? ????? ??????????? ?????? ??? ?????? ?????? ??? ??????, ???? ??????????? ?????????? ????? ?????? ????????? ?????

?.? ????? ????????

?????????????? ????, ??????? ?????? ?????????? ???? ?????? ??????, ?? ????? (???? ???????) ???? ??? ???? ???? ???? ??????? ????

?.? ????????????

?????????? ????? ??????????? ??????: A B ?? ??? ?????? ???, ?? ???? ?? ?? Systemd ??? A ???? ???, ??? ??? ??? ???? B-? ???? ?????

systemctl list-dependencies ???? ??????? ????? ???????????? ??????????? ???? ???????

????? ???????? ??????? ???? ???????????? ??????? ???????? (???? ????????? ?????), ?? ?????????? ????????? ??? ??? ??? ??????????? ????? ???, ????? ?????? ??????? ???? ??? --all ????????????

????, ??????? ?????????? ????

?.? ??????????

??????? ??????? ???? ?????????? ???? ????, ?? ?????????? ?????? ?????? ??? ??????? ???? ???? ????

Systemd ?????????? ????????? ???? /etc/systemd/system/ ?????????? ???? ?????? ???, ?? ????? ???? ??????? ????? ???? ?????????? ???? ??????? ??? ???????? ?????? /usr/lib/systemd/system/ ???? ?????????? ?????? ??? ??????????? ???? ???????

systemctl enable ?? ???????? ????? ???? ?????????? ????? ???? ??????? ????? ??????? ?????? ???? ??????? ????

??? ?????????? ????? ??? ???? ???? ???? ???? ???? ??? ??? ????, systemctl enable ????????? ??????? ???? ???? ???? ??????? ????

?? ???? ??????????????, systemctl disable ???? ?????????? ????? ???? ?????????? ????? ???????? ????? ??????? ????? ???? ???? ??????, ?? ??? ????????? ????? ???? ?????

?????????? ?????? ????????? ?? ??? ??????? ??????, ???? sshd.socket ??? ??? ?????? ???, Systemd ?? ?????? ???? ??? ?? .service ????? sshd ???? ??? sshd.service 。

?.? ?????????? ?????? ??????

systemctl list-unit-files ?????? ????? ?????????? ???? ??????????? ???? ??????? ????

?? ???????? ???? ?????? ?????? ?????

?? ???????? ??????? ???????????? ??????? ?????? ??????, ??? ??? ??????

  • ?????: ???? ????? ?????????? ??????
  • ?????: ???? ???? ????? ???? ?????
  • ?????????: ?? ?????????? ???? ??? [Install] ??? (??????? ??? ???? ??), ????????? ???????? ?????????? ?????? ?????????? ??????? ??? ???? ?????
  • ??????: ?? ?????????? ?????? ????????? ????? ???? ???? ????????

???? ??? ?????? ????, ?????????? ?????? ?????? ???? ???? ???? ?? ??, ?? ??????? ???? ????? ??? ?????? ???????? ????? ???? ???? systemctl status ?????

????? ?????????? ???? ???????? ???? ??, SystemD-?? ?????????? ???? ??????? ??? ???? ??? ??? ????? ??????? ???? ???? ???, ???????? ???????? ??????? ??? ???

?.? ?????????? ?????? ???????

?????????? ???? ?? ???? ?????? ?????? ????, ?? ?????? ????? ????? ???? ?????

systemctl cat ????????? ?????????? ?????? ?????????? ????? ?????

????? ?????? ???? ???? ??????, ?????????? ?????? ??????? ????? ??? ??? ??????? ??????? ?????? ????? ??????, ???? ???????? ?????? ?????? ??????? ????? ??????? ????????? ???, ???? [Unit] ???? ??? ?????? ????, ?????????? ?????? ???? ??? ??? ????????? ??? ????? ??? ??? ??? ????? ??????? ????? ??????????

??????? ?????? ????????? ???? ???? ????? ?????? ??????? ??-????? ???? ???????

5.4 ?????????? ?????? ????

[Unit] ???? ??????? ?????????? ?????? ????? ????, ?? ??????? ???????? ?????????? ???? ??? ???????? ??????? ???? ??????? ??????? ???? ??????? ???? ?? ?????? ??????????? ???? ?????? ????

  • Dsecription ????????? ??????
  • Documentation ?????????? ??????
  • Requires ??????? ??????? ????????? ???????? ????? ??? ???? ?? ????, ????? ??????? ????? ???? ??? ?????? ????
  • Wants ??????? ??????? ???? ??????? ???????? ?????????, ??? ?????? ????? ?? ????, ??? ??????? ??????? ?????????? ???? ??? ???
  • BindsTo ??? Requires ??? ?????? ??? ?? ????????? ????? ??? ???? ???? ????, ????? ??????? ????? ??? ??? ???? ??? ?????
  • Before ??? ????????? ????????? ?????? ???? ???? ???, ??? ??? ??????? ??????? ??? ???? ???? ????
  • After ??? ?? ????????? ????????? ?????? ???? ???? ???, ????? ??? ??????? ??????? ??? ???? ???? ????
  • Conflicts ????? ????????? ??????? ??????? ??????? ???? ?????? ?????? ???? ???
  • Condition... ??????? ????? ??????? ???? ??????????? ???????? ???? ???? ???, ???????? ??? ???? ???
  • Assert... ??????? ??????? ???? ???? ?? ???????? ???? ???? ???, ?? ?? ??? ??? ???? ??? ?????? ????

[Install] ??????? ??? ?????????? ?????? ????? ????, ?? ?????? ???? ???? ??? ??? ?? ?? ??? ???? ???? ?? ???????? ???? ?? ?????? ??????????? ?????????

  • WantedBy ?? ??? ???? ?? ?????? ???????, ??????? ????? ??????? ??? (???????) ?????? ????? ?????? ??? ???? /etc/systemd/system ???? ???? ?????? ??????? ??? + .wants ????????? ???? ??????? ?????
  • RequiredBy ?? ??? ???? ?? ?????? ???????, ??????? ????? ??????? ?????????, ???????? ????????? ???? ???? /etc/systemd/system ???? ???? ?????? ??????? ??? + .required ????????? ???? ??????? ?????
  • Alias ??????? ??????? ???? ?????? ???? ???? ?????
  • Also ??????? ????? ??????? (?????) ???, ??? ???? ??????? ????? ???????? ??????

[Service] ????????? ???????????? ???? ????, ????????? ??????? ?????? ??????? ???? ?? ?????? ??????? ?? ?????? ??????????? ?????????

  • Type ???? ???? ???? ??????????? ???? ?????????? ????? ?? ?????????? ??????? ??? ???????
  • Type=simple ?????? ???, ??????? ???? ExecStart ????????? ??????, ?????? ?????????? ???? ?????
  • Type=forking : ????????? ?????????? ???? ???? ???????? ???? ???? ?????????? ???? ??? ???, ???? ?????? ?? ???????? ?????????? ????????????? ??? ???? ?????
  • Type=oneshot ??? ??????????, Systemd ??????? ??????? ??? ????? ??????? ??????? ????, ????? ??????? ????????? ??????? ?????
  • Type=dbus ??????? ???? D-Bus ?? ??????? ???? ????
  • Type=notify ??????? ???? ???? ???? ????, ?????? ???? Systemd ??? ??????? ????
  • Type=idle ??? ???? ???? ??? ??????? ???, ???? ??????? ??????? ???? ????
  • ExecStart ??????? ?????? ???? ???? ??????
  • ExecStartPre ??????? ??????? ???? ???? ??? ????????? ??????
  • ExecStartPost ??????? ???? ???? ???? ?? ??????? ??? ??? ??? ????
  • ExecReload ??????? ????????? ??????? ???? ???? ???? ??????? ??? ??? ??? ??????
  • ExecStop ??????? ??????? ???? ???? ???? ???????? ??????
  • ExecStopPost : ??????? ???? ???? ??? ??????? ??? ???? ???? ????
  • RestartSec ??????? ????? ???????????? ??????? ???? ???? ???? ???????? (????????)
  • Restart ??? ??????????? Systemd ???????????????? ??????? ??????? ??????? ???? ????, ???????? ??? ???????????: always (?????? ?????????) on-success 、 on-failure 、 on-abnormal 、 on-abort 、 on-watchdog
  • TimeoutSec Systemd ??????? ??????? ???? ???? ??? ??????? ???? ????????? ?????? ?????????? ?????
  • Environment ????????? ?????? ???????????

????? ?????????? ?????? ???????? ????????? ??????? ????, ???? ??? ?????? ?????? ????????

???, ??????

????????? ???? ???? ???? ???? ????? ???? ???? ???? ??? ???????? ???? ???? ???? ??????? ??????? ????????? ?????? ???? ???, ??? ??? ???????? ??? ??????????? Systemd ?? ?????? ?? ????????

簡(jiǎn)單說(shuō),Target 就是一個(gè) Unit 組,包含許多相關(guān)的 Unit 。啟動(dòng)某個(gè) Target 的時(shí)候,Systemd 就會(huì )啟動(dòng)里面所有的 Unit。從這個(gè)意義上說(shuō),Target這個(gè)概念類(lèi)似于"狀態(tài)點(diǎn)",啟動(dòng)某個(gè) Target 就好比啟動(dòng)到某種狀態(tài)。

??????? init ????????? ????, RunLevel ?? ????? ???, ?? Target ?? ??????????? ???? ???? ????????????? ???????? ???, RunLevel ????????????? ??? ????? ??? ????, ?????? RunLevel ?????? ???? ??? ???? ??, ?????? ?????? Target ?????? ???? ??? ?????

Target ??? ??????? RunLevel ?? ????? ??????? ????????:

??? ???? init ??????????? ?????? ???????????? ?????????

?????? ???????? (???) /etc/inittab ???? ??????) ??? ?????? ??????? ?????? ???????????? ??????, ??????? ?? /etc/systemd/system/default.target ??????? ????????? ??????? ??? graphical.target (????????? ?????????) ???? multi-user.target (??? ??????????? ?????? ????)

(?) ????????? ???? ???? ??????? ??? ??? /etc/init.d ?????????, ??????? ??? ????? ??????????? ???????? ????? (???? /etc/rc3.d 、 /etc/rc5.d ??? ??? ???????? ??? /lib/systemd/system ??? /etc/systemd/system ???????????

(?) ?????????? ?????? ??????? ??? init ??????????? ?????????? ???? ?? /etc/inittab ??????? ???????? ?????????? ???????? ???????? ???? /etc/sysconfig ????? ???????? ?????????? ???????? ??????? ???????? ?????? /lib/systemd ??????, ????? /etc/systemd ?????????? ????? ???????????? ??? ???????? ???????? ???? ?????

???. ?? ???????????

Systemd ????? ??????? ??????? ?? ??????????? ???????? ???? ?? ??? ?????? ???, ???? ????????? journalctl ???? ??????, ????? ?? ????? ???? (?????? ?? ??? ???????????? ??)? ???? ?????????? ???? ?? /etc/systemd/journald.conf 。

journalctl ?????????, ??????? ???? ???? ????? ???????

(??????)

?????????? ????

???? ?????????????? ??????? ??????:

?????? ???? QQ
男女疯狂一边摸一边做羞羞视频|啊好深好硬快点用力别停动态图|亚洲一区无码中文字幕|特级无码毛片免费视频播放▽|久久狠狠躁免费观看|国内精品久久久久久网站