Systemd簡介CentOS 7 使用 Systemd 替換了SysV Ubuntu 從 15.04 開始使用 Systemd Systemd 是 Linux 系統(tǒng)工具,用來啟動守護進程,已成為大多數(shù)發(fā)行版的標(biāo)準(zhǔn)配置 特點優(yōu)點:
缺點:
架構(gòu)圖Unit(單元|服務(wù))Systemd 可以管理所有系統(tǒng)資源:
Unit File(單元文件|配置文件)單元文件中包含該單元的描述、屬性、啟動命令等 類型Systemd 將系統(tǒng)資源劃分為12類,對應(yīng)12種類型的單元文件
語法單元文件的語法來源于 XDG桌面入口配置文件 Unit 文件可以分為三個配置區(qū)段:
Unit 段主要字段如下:
Install 段主要字段如下:
Service 段主要字段如下: 【啟動類型】
【啟動行為】
【重啟行為】
【上下文】
占位符在 Unit 文件中,有時會需要使用到一些與運行環(huán)境有關(guān)的信息,例如節(jié)點 ID、運行服務(wù)的用戶等。這些信息可以使用占位符來表示,然后在實際運行中動態(tài)地替換為實際的值。 模板在現(xiàn)實中,往往有一些應(yīng)用需要被復(fù)制多份運行,就會用到模板文件 模板文件的寫法與普通單元文件基本相同,只是模板文件名是以 @ 符號結(jié)尾。例如:apache@.service 通過模板文件啟動服務(wù)實例時,需要在其文件名的 @ 字符后面附加一個用于區(qū)分服務(wù)實例的參數(shù)字符串,通常這個參數(shù)是用于監(jiān)控的端口號或控制臺 TTY 編譯號
Systemd 在運行服務(wù)時,首先尋找跟單元名完全匹配的單元文件,如果沒有找到,才會嘗試選擇匹配模板 例如上面的命令,System 首先會在約定的目錄下尋找名為 apache@8080.service 的單元文件,如果沒有找到,而文件名中包含 @ 字符,它就會嘗試去掉后綴參數(shù)匹配模板文件。對于 apache@8080.service,Systemd 會找到 apache@.service 模板文件,并通過這個模板文件將服務(wù)實例化。 狀態(tài)
示例
Systemd 內(nèi)建命令
|
動作 | SysV Init 指令 | Systemd 指令 |
---|---|---|
啟動某服務(wù) | service httpd start | systemctl start httpd |
停止某服務(wù) | service httpd stop | systemctl stop httpd |
重啟某服務(wù) | service httpd restart | systemctl restart httpd |
檢查服務(wù)狀態(tài) | service httpd status | systemctl status httpd |
刪除某服務(wù) | chkconfig --del httpd | 停掉應(yīng)用,刪除其配置文件 |
使服務(wù)開機自啟動 | chkconfig --level 5 httpd on | systemctl enable httpd |
使服務(wù)開機不自啟動 | chkconfig --level 5 httpd off | systemctl disable httpd |
查詢服務(wù)是否開機自啟 | chkconfig --list | grep httpd | systemctl is-enabled httpd |
加入自定義服務(wù) | chkconfig --add test | systemctl load test |
顯示所有已啟動的服務(wù) | chkconfig --list | systemctl list-unit-files | grep enabled |
--all
顯示加載到內(nèi)存的所有單元
--type
-t
--type=
顯示指定類型(12種類型)的單元
--state
--state=
顯示指定狀態(tài)的單元或單元文件
單元狀態(tài)
輸入
systemctl list-units --state
按Tab
鍵,顯示所有可用的值單元文件狀態(tài)
另外還可以用 enabled static disabled 等
systemctl list-unit-files
顯示的狀態(tài)
--failed
--state=failed
顯示加載失敗的單元
systemctl --failed
--version
打印 Systemd 版本
lfp@legion:/lib/systemd/system$ systemctl --version
Systemd 237
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid
我的理解
- systemd 對單元的管理,不涉及單元文件自身屬性和內(nèi)容
list-units
相當(dāng)于systemctl
列出當(dāng)前已加載的單元(內(nèi)存)
默認情況下僅顯示處于激活狀態(tài)(正在運行)的單元
UNIT 單元名
LOAD 加載狀態(tài)
ACTIVE SUB 執(zhí)行狀態(tài)(大狀態(tài) 子狀態(tài))
DESCRIPTION 描述
start
啟動單元
systemctl start mysql.service
stop
停止單元
systemctl stop mysql.service
kill
殺掉單元進程
systemctl kill mysql.service
reload
不終止單元,重新加載 針對該單元的 運行配置文件,而不是 針對 systemd的 該單元的啟動配置文件
例如啟動 MySQL 服務(wù),reload 可以在不停止服務(wù)的情況下重載 MySQL 的配置文件
my.cnf
restart
重啟單元
該單元在重啟之前擁有的資源不會被完全清空,比如文件描述符存儲設(shè)施
systemctl reload mysql.service
status
status [unit | PID]
顯示單元或進程所屬單元的運行信息
systemctl status mysql.service
Loaded
行:配置文件的位置,是否設(shè)為開機啟動
Active
行:表示正在運行
Main PID
行:主進程ID
CGroup
塊:應(yīng)用的所有子進程日志塊:應(yīng)用的日志
is-active
判斷指定的單元是否處于激活狀態(tài)
# 默認會打印當(dāng)前單元的狀態(tài),可以通過 --quiet 參數(shù)取消打印
lfp@legion:~$ systemctl is-active mysql
active
is-failed
判斷指定的單元是否處于啟動失敗狀態(tài)
lfp@legion:~$ systemctl is-failed mysql
active
list-dependencies
查看單元之間的依賴關(guān)系
systemctl list-dependencies graphical.target
systemctl list-dependencies mysql.service
show
show --property= Unit
?=> show -p Unit
顯示單元所有底層參數(shù)
lfp@legion:~$ systemctl show -p MainPID mysql
MainPID=1061
set-property
在單元啟動的時候設(shè)置運行時的某個屬性,立即生效,并保存在磁盤中作為啟動配置
如果添加了--runtime
則重啟后失效
并非所有的屬性都可以設(shè)置,只是 systemd.resource-control 包含的屬性
isolate
切換到某個 target(系統(tǒng)狀態(tài)),立即停止該 target 未包含的單元進程。也可以理解為切換 runlevel
如果沒有指定擴展名,則默認.target
只有當(dāng).target單元文件中的AllowIsolate=yes
時,才能使用 isolate 切換;也可以用IgnoreOnIsolate=yes
字段來拒絕使用 isolate 切換
systemctl isolate multi-user.target
cat
顯示單元配置文件的備份文件,包括插入式配置drop-ins
,可以完整的看到單元服務(wù)的配置。注意這里打印的依據(jù)是磁盤的上內(nèi)容,如果用戶修改了配置文件(磁盤已修改)但是未執(zhí)行daemon-reload
命令(內(nèi)存中未更新),那么該命令顯示的配置和實際執(zhí)行情況有出入
lfp@legion:~$ systemctl cat mysql.service
# /lib/systemd/system/mysql.service
# MySQL Systemd service file
[Unit]
Description=MySQL Community Server
...
[Install]
WantedBy=multi-user.target
[Service]
Type=forking
...
# 這段就顯示的是 插入式配置 drop-in 的內(nèi)容
# /etc/systemd/system/mysql.service.d/mysql.conf
# MySQL Systemd service file
[Unit]
# Description=MySQL Community Server conf
[Service]
# ExecStartPost=/home/lfp/bin/espeak.sh
我的理解
- systemd 對單元文件自身屬性和內(nèi)容的管理
list-unit-files
列出所有已安裝的單元文件和它們的啟用狀態(tài)
和
list-units
的區(qū)別是
- list-units 僅顯示當(dāng)前已加載到內(nèi)存中的單元
- list-unit-files 會讀取單元文件內(nèi)容,列出所有單元,包括存在于硬盤未加載進內(nèi)存的單元
實際測試結(jié)果:
systemctl list-unit-files 顯示“348 Unit files listed”
systemctl list-units --all 顯示“405 loaded units listed”
systemctl list-units 顯示 “232 loaded units listed”
enable
使某個單元開機自啟動
這會根據(jù)單元文件內(nèi)容中的[Install]
指定的 target 組,創(chuàng)建一個軟鏈接
lfp@legion:/etc/systemd/system$ vim v2rayL.service # 文件內(nèi)容 [Install] 段 ...... [Install] WantedBy=multi-user.target ...... lfp@legion:/etc/systemd/system$ systemctl is-enabled v2rayL.service disabled lfp@legion:/etc/systemd/system$ systemctl enable v2rayL.service # 根據(jù) [Install] 段指定的組,添加軟鏈接 Created symlink /etc/systemd/system/multi-user.target.wants/v2rayL.service → /etc/systemd/system/v2rayL.service. lfp@legion:/etc/systemd/system$ systemctl is-enabled v2rayL.service enabled
disable
取消某個單元開機自啟動設(shè)置,刪除軟鏈接
這會刪除所有指向該單元文件的軟鏈接,不僅僅是 enable 操作創(chuàng)建的
reenable
disable 和 enable 的結(jié)合,根據(jù)單元文件內(nèi)容中的 [Install] 段,重置軟鏈接
is-enabled
檢查某個單元是否是開機自啟動的(建立的啟動鏈接)
lfp@legion:~$ systemctl is-enabled mysql
enabled
get-default
獲取默認啟動 target,default-target 是指向該 target 的軟鏈接
set-default
設(shè)置默認啟動 target,同時修改 default-target 指向設(shè)定的 target
systemctl set-default multi-user.target
daemon-reload
重新加載所有的單元文件和依賴關(guān)系
對單元文件有修改的時候,需要執(zhí)行該命令重新加載文件內(nèi)容
reboot
systemctl reboot
重啟系統(tǒng)(異步操作)
it will return after the reboot operation is enqueued, without waiting for it to complete
poweroff
關(guān)閉系統(tǒng),切斷電源(異步操作)
halt
僅CPU停止工作,其他硬件仍處于開機狀態(tài)(異步操作)
suspend
暫停系統(tǒng)(異步操作)
將觸發(fā)執(zhí)行suspend.target
hibernate
讓系統(tǒng)進入冬眠狀態(tài)(異步操作)
將觸發(fā)執(zhí)行hibernate.target
/run/systemd/system/
單元(服務(wù))運行時生成的配置文件所在目錄
/etc/systemd/system/
系統(tǒng)或用戶自定義的配置文件,初始化過程中Systemd
只執(zhí)行/etc/systemd/system
目錄里面的配置文件
/lib/systemd/system/
軟件安裝時添加的配置文件,類似于 /etc/init.d/
對于支持 Systemd 的程序,安裝的時候,會自動的在 /lib/systemd/system
目錄添加一個配置文件
其他目錄都是軟鏈接
/etc/systemd/system/default.target
Systemd 執(zhí)行的第一個單元文件,符號鏈接到默認啟動 target 對應(yīng)的 .target
單元文件
SysV 的啟動腳本放在/etc/init.d
目錄下
Systemd 的單元文件放在/etc/systemd/system
和 /lib/systemd/system
目錄下
當(dāng)一個程序在3個目錄下都存在啟動方式時,優(yōu)先級是/etc/systemd/system --> /lib/systemd/system --> /etc/init.d
lfp@legion:/etc/init.d$ ll
-rwxr-xr-x 1 root root 5650 5月 19 22:09 mysql*
lfp@legion:/etc/systemd/system$ ll
-rw-r--r-- 1 root root 511 5月 20 01:42 mysql.service
lfp@legion:/lib/systemd/system$ ll
-rw-r--r-- 1 root root 499 5月 20 01:20 mysql.service
/etc/systemd/system
里面的同名service會覆蓋/lib/systemd/system
里面的
注意查看文件信息,該同名文件不能是指向 /lib/systemd/system 的軟鏈接
軟鏈接不會覆蓋而會同步
如果某個程序不存在Systemd 單元文件,那么會執(zhí)行/etc/init.d
里面的啟動腳本
根據(jù)啟動過程,
/etc/systemd/system/multi-user.target.wants/
目錄下是很多指向/lib/systemd/system/
目錄的軟鏈接,所以兩個目錄下的單元文件會互相同步。如果
/etc/systemd/system/
和/etc/systemd/system/multi-user.target.wants/
同時存在單元文件,測試發(fā)現(xiàn),不管是手動啟動還是開機自啟動,使用的都是/etc/systemd/system/
目錄下的service單元文件
/etc/init.d
目錄下的腳本mysql 修改 mysql.service
為mysql.service.bak
然后通過service mysql restart
啟動/etc/init.d/mysql
腳本
下面是啟動后的一些信息
注:在恢復(fù)
mysql.service
之前,需要先通過service mysql stop
利用/etc/init.d/mysql
腳本中的stop
結(jié)束上面的進程,否則一旦恢復(fù),service mysql stop
執(zhí)行的操作就不是/etc/init.d/mysql
腳本中的stop
,無法結(jié)束上面的進程,出現(xiàn)命令無法正常執(zhí)行的情況
結(jié)束上面的進程,恢復(fù)mysql.service
,重新啟動
/etc/systemd/system
覆蓋測試未修改前,查看MySQL的狀態(tài)
lfp@legion:~$ service mysql status
● mysql.service - MySQL Community Server
# 可以發(fā)現(xiàn)這里的 mysql.service 是在 /lib/systemd/system 下面
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: en
Active: active (running) since Sat 2020-04-25 18:34:30 CST; 5h 33min ago
Main PID: 988 (mysqld)
Tasks: 28 (limit: 4915)
CGroup: /system.slice/mysql.service
└─988 /usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid
4月 25 18:34:30 legion Systemd[1]: Starting MySQL Community Server...
4月 25 18:34:30 legion Systemd[1]: Started MySQL Community Server.
將 /lib/systemd/system 下面的文件復(fù)制到 /etc/systemd/system/
下面
sudo cp /lib/systemd/system/mysql.service /etc/systemd/system/
修改 mysql.service
sudo vim /etc/systemd/system/mysql.service
?
重啟 mysql.service ,系統(tǒng)提示需要重新加載
lfp@legion:~$ systemctl restart mysql.service
Warning: The Unit file, source configuration file or drop-ins of mysql.service changed on disk.
Run 'systemctl daemon-reload' to reload units.
lfp@legion:~$ systemctl daemon-reload# 重新加載
lfp@legion:~$ systemctl restart mysql.service # 重啟
lfp@legion:~$ systemctl status mysql.service
● mysql.service - MySQL Community Server hahahaha# 發(fā)現(xiàn)這里是修改之后的,覆蓋了 /lib/systemd/lib 中的
# 這里也可以看到加載路徑
Loaded: loaded (/etc/systemd/system/mysql.service; enabled; vendor preset: en
Active: active (running) since Sun 【2020-04-26】 00:47:02 CST; 5s ago
Process: 21590 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/m
Process: 21581 ExecStartPre=/usr/share/mysql/mysql-Systemd-start pre (code=exi
Main PID: 21592 (mysqld)
Tasks: 27 (limit: 4915)
CGroup: /system.slice/mysql.service
└─21592 /usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pi
4月 26 00:47:02 legion Systemd[1]: Starting MySQL Community Server hahahaha...
4月 26 00:47:02 legion Systemd[1
兩個含義
系統(tǒng)的某個狀態(tài)稱為一個 target(類似于"狀態(tài)點")
達到某個系統(tǒng)狀態(tài),所需的一個或多個資源(Unit)稱為一個 target(一個 Unit 組)
target是一個抽象的系統(tǒng)資源,不像MySQL有實體
如果一個target只包含一個Unit,那么該 target,沒有對應(yīng)的目錄,指的就是這個 Unit
例如
hibernate.target
只包含systemd-hibernate.service
一個Unit如果一個target包含多個Unit,那么該target,有對應(yīng)的 xxx.target.wants 目錄,指的是目錄里面所有的Unit
例如
multi-user.target
包含位于/etc/systemd/system/multi-user.target.wants
目錄下的多個 Unit
target也是一個 Target 類型的系統(tǒng)資源,有對應(yīng)的單元文件 xxx.target
Systemd 使用 target 來劃分和管理資源(Unit),啟動(激活)某個 xxx.target 單元文件,通過執(zhí)行該 target 包含的 Unit,使系統(tǒng)達到某種狀態(tài)
對于狀態(tài)點的理解:
例如,執(zhí)行
systemd suspend
命令讓系統(tǒng)暫停,會觸發(fā)啟動suspend.target
,然后執(zhí)行里面的systemd-suspend.service
Unit,使系統(tǒng)達到一個暫停的狀態(tài)
傳統(tǒng)的init
啟動模式里面,有 RunLevel 的概念,跟 Target 的作用很類似。不同的是,RunLevel 是互斥的,不可能多個 RunLevel 同時啟動,但是多個 Target 可以同時啟動
runlevel是 SysV init 初始化系統(tǒng)中的概念,在Systemd初始化系統(tǒng)中使用的是 Target,他們之間的映射關(guān)系是
Runlevel | Target | 說明 |
---|---|---|
0 | poweroff.target | 關(guān)閉系統(tǒng) |
1 | rescue.target | 維護模式 |
2,3,4 | multi-user.target | 多用戶,無圖形系統(tǒng)(命令行界面) |
5 | graphical.target | 多用戶,圖形化系統(tǒng)(圖形用戶界面) |
6 | reboot.target | 重啟系統(tǒng) |
讀入 /boot
目錄下的內(nèi)核文件
內(nèi)核文件加載完之后,開始執(zhí)行第一個程序/sbin/init
初始化進程,由 Systemd 初始化系統(tǒng)引導(dǎo),完成相關(guān)的初始化工作
Systemd 執(zhí)行default.target
,獲知設(shè)定的啟動 target
實際上
default.target
是指向設(shè)定的啟動 target 的軟鏈接
Systemd 執(zhí)行啟動 target 對應(yīng)的單元文件。根據(jù)單元文件中定義的依賴關(guān)系,傳遞控制權(quán),依次執(zhí)行其他 target 單元文件,同時啟動每個 target 包含的單元
對于圖形化界面,默認 target 是 graphical,Systemd 執(zhí)行位于
/lib/systemd/system/
目錄下的 graphical.target 單元文件,根據(jù) target 單元文件中定義的依賴關(guān)系,依次啟動其他 target 單元文件以及各個 target 包含的位于/etc/systemd/system/
目錄下的單元例如: graphical.target 的依賴關(guān)系是
[Unit] Description=Graphical Interface Documentation=man:systemd.special(7) Requires=multi-user.target # Wants=display-manager.service # Conflicts=rescue.service rescue.target After=multi-user.target rescue.service rescue.target display-manager.service # AllowIsolate=yes
因此,依次啟動 multi-user.target --> basic.target --> sysinit.target --> local-fs.target -->local-fs-pre.target --> ...
同時啟動每個 target 包含的位于
/etc/systemd/system/
目錄下的UnitSysV對應(yīng)的 rc5.d --> /etc/init.d 目錄下的指定的腳本就不會在開機的時候執(zhí)行了
systemctl get-default
lfp@legion:~$ runlevel
N 5
lfp@legion:~$ systemctl get-default
graphical.target
systemctl set-default [xxx.target]
# Ubuntu18.04
# 圖形用戶界面 切換 命令行界面
sudo systemctl set-default multi-user.target
# 命令行界面 切換 圖形用戶界面
systemctl set-default graphical.target
reboot
# 命令行界面 想進入 圖形用戶界面(僅進入一次,重啟系統(tǒng)后仍然會進入命令行模式)
sudo systemctl start lightdm
直接修改/lib/systemd/system
目錄下的單元文件
如果軟件包更新,修改會被丟棄
將/lib/systemd/system
中的單元文件復(fù)制到/etc/systemd/system/
如果軟件包更新,不會同步更新
在/etc/systemd/system/
中添加配置(推薦)
步驟:
/etc/systemd/system/
目錄下新建<單元名>.d
目錄<單元名>.d
目錄下,新建<單元名>.conf
文件<單元名>.conf
文件中修改配置測試:
創(chuàng)建目錄及文件
# /mysql.service.d
lfp@legion:/etc/systemd/system/mysql.service.d$ ls
mysql.conf
修改配置
# MySQL Systemd service config file
# 不需要所有的組,僅添加需要修改的組及選項
[Unit]
Description=MySQL Community Server config test
[Service]
ExecStartPost=/home/lfp/bin/espeak.sh
重啟測試
lfp@legion:/etc/systemd/system/mysql.service.d$ systemctl daemon-reload
lfp@legion:/etc/systemd/system/mysql.service.d$ systemctl restart mysql.service
lfp@legion:/etc/systemd/system/mysql.service.d$ systemctl status mysql.service
lfp@legion:/etc/systemd/system/mysql.service.d$ systemctl status mysql.service
# 描述已經(jīng)被修改
● mysql.service - MySQL Community Server config test
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
# 加入了配置文件
Drop-In: /etc/systemd/system/mysql.service.d
└─mysql.conf
Active: active (running) since Thu 2020-05-21 20:18:02 CST; 12min ago
# 新增的動作執(zhí)行成功
Process: 4703 ExecStartPost=/home/lfp/bin/espeak.sh (code=exited, status=0/SUCCESS)
Process: 4672 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid (code=exited, status=0/SUCCESS)
Process: 4663 ExecStartPre=/usr/share/mysql/mysql-Systemd-start pre (code=exited, status=0/SUCCESS)
Main PID: 4674 (mysqld)
Tasks: 27 (limit: 4915)
CGroup: /system.slice/mysql.service
└─4674 /usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid
5月 21 20:18:02 legion espeak.sh[4703]: ALSA lib pcm_route.c:867:(find_matching_chmap) Found no matching channel map
rc.local
文件/lib/systemd/rc.local.service
# 如果存在,就自動添加到 multi-user.target
# This Unit gets pulled automatically into multi-user.target by
# Systemd-rc-local-generator if /etc/rc.local is executable.
[Unit]
Description=/etc/rc.local Compatibility
Documentation=man:systemd-rc-local-generator(8)
ConditionFileIsExecutable=/etc/rc.local
After=network.target
[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
RemainAfterExit=yes
GuessMainPID=no
創(chuàng)建 rc.local 文件,賦予可執(zhí)行權(quán)限,即可添加啟動命令
sudo touch /etc/rc.local
chmod 755 /etc/rc.local
lfp@legion:/etc$ vim rc.local
#!/bin/sh -e
echo "test rc.local" > /usr/local/rclocal.log
echo "rc.local `date +%Y-%m-%d-%H:%M:%S`" >/home/lfp/log/rclocal.log
exit 0
hostnamectl status
Show current system hostname and related information
lfp@legion:/lib/systemd/system$ hostnamectl status
Static hostname: legion
Icon name: computer-laptop
Chassis: laptop
Machine ID: b28xxxxxxxx2ecafa29e
Boot ID: 21xxxxxxxxxxxx1d3a47504d
Operating System: Ubuntu 18.04.4 LTS
Kernel: Linux 5.3.0-51-generic
Architecture: x86-64
Systemd 統(tǒng)一管理所有 Unit 的啟動日志。帶來的好處就是,可以只用journalctl
一個命令,查看所有日志(內(nèi)核日志和應(yīng)用日志)。
配置文件
/etc/systemd/journald.conf
日志保存目錄
/var/log/journal/
默認日志最大限制為所在文件系統(tǒng)容量的 10%,可通過 /etc/systemd/journald.conf
中的 SystemMaxUse 字段來指定
該目錄是 systemd 軟件包的一部分。若被刪除,systemd 不會自動創(chuàng)建它,直到下次升級軟件包時重建該目錄。如果該目錄缺失,systemd 會將日志記錄寫入 /run/systemd/journal。這意味著,系統(tǒng)重啟后日志將丟失。
journalctl -u [服務(wù)名]
查看指定單元的日志
journalctl -b
http://manpages./manpages/bionic/en/man1/systemctl.1.html
http://manpages./manpages/bionic/en/man5/systemd.unit.5.html
https://www.cnblogs.com/yingsong/p/6012180.html
https://www.cnblogs.com/sparkdev/p/8472711.html
http://www./blog/2016/03/systemd-tutorial-commands.html
http://www./blog/2016/03/systemd-tutorial-part-two.html
https:///linux-how-to/systemd-boot-process/
https://cloud.tencent.com/developer/article/1516125
https://www.cnblogs.com/sparkdev/p/8472711.html
https://www.ibm.com/developerworks/cn/linux/1407_liuming_init3/index.html?ca=drs-
|