Outline
時間:112 年 04 月 21 日 9:00
地點:線上
線上會議連結 : Online
出席者:吳坤熹老師、謝萬霖、吳騰然、劉怡君、田蕙瑜、莊才賢、紀見如、劉冠伶、林大智、繆亭霄
會議主題:Systemd
主講者: 莊才賢
主記: 劉怡君
How Linux Machine Boot
runlevel
as an init
/etc/rc[0-6S].d
runlevels
vs systemd
/etc/rc0.d
shows the init scripts at runlevel N 0 , it means it runs at halt statusrunlevel
at command line to check the current runlevel.multi-user.target
, graphical.target
.multi-user.target
, the services specified at graphical.target
would executebasic.target
is the implicit dependencies, which means the basic system service would all startservice ordering
Systemd
Format of unitfile(Section Directives)
General parts
Description=
Documentation=
systemctl status
查看)Documentation=man:sshd(8) man:sshd_config(5)
OnFailure=
, OnSuccess=
Requires=
Wants=
BindsTo=
Before=
After=
Optional parts
WantedBy=
Want=
WantedBy=multi-user.target driective
,啟用的時候就會被 link 到這個目錄 /etc/systemd/system/multi-user.target.wants
,取消的時候 link 就會被刪除RequiredBy=
/etc/systemd/system/multi-user.target.requires
Unit-Specific
man bootup
Type=
ExecStart=
ExecStartPre=
ExecReload=
ExecStop=
TimeoutSec=
multi-user.target
Requires and After basic.target
basic.target
is donegraphical.target
Requires and After multi-user.target
multi-user.target
is doneLawrence p.26 關於路徑的設定,script 一定要放在 /usr/local/bin 嗎?
Ans: [name=] 不一定,想放在 home direfctory 也行。
Jennifer p.12 為什麼分成多個 Unit 就可以做到更多事情?
Ans: 全部寫在同一個 file 會比較不好 debug。
August p.21 target 跟 service 的差別?
Ans: target 不是 section directive
Ashely p.23 這些參數一定要寫嗎? 還是 optional?
Ans: 有些不寫的話會出問題,通常自定義的 service 會用 simple。
Angela P.19 What's the difference between "Forward" and "Reverse"?
Ans: For example, sshd -> multi-user.target. Reverse 的話, 你 multi-user.target 中就不用再 specify dependency.
Angela p.16 the seqence of listed points should be the same with table items
Phoebe P.21 isolate 可以往上也可以往下切換?
Ans: 可以。
Toby p.21 可以把一個開起來,其他全部關掉?
Ans: 比較精確的講法是,把一個 target 底下的 service 全部開起來.
Toby p.28 可以修改 log msg 還是說可以自定義 log msg?
Ans: 可以自定義。
Edgar 用 systemctl isolate 指令切換 runlevel 後可以直接透過 runlevel
直接查看嗎?
Ans: 可以。
Edgar p.19 相依性必須自己去注意對嗎?
Ans:
Edgar p.12 還原用start or enable?
Ans:
Edgar p.24 ExecStartPre=
command 後面接了 -
任何 return 值為非零的狀況都會被容忍,這之間是否需要空白隔開?
Ans: 這我只在文件上看到,細節要再試試。
Edgar P.29 What is the minimum value of AccuracySec?
Ans: 1ms. (Edgar: "I have seen 1us.")
Solomon p.26 Why use cp instead of ln when ln can yield a similar result?
Ans: The tutorials recommend using the cp command, but based on your suggestion, using the hardlink option would be a better choice.
Solomon p.22 If I specified "After", do I still need to specify "Requires"?
Ans: It depends. If some other services have "required" the service which you depend, the your service can successfully start. However, if no other service "requires" the service, then no one starts the service, and your service will indefinitely wait for that.
散會結束時間: