范例一:列出系
上面有
启动
unit
[root@study ~]#
systemctl
UNIT LOAD ACTIVE SUB DESCRIPTION
proc
-
sys
-
fs
-
binfmt_mis... loaded active waiting Arbitrary Executable File Formats File System
sys
-
devices
-
pc...:0:1:... loaded active plugged QEMU_HARDDISK
sys
-
devices
-
pc...0:1
-
0... loaded active plugged QEMU_HARDDISK
sys
-
devices
-
pc...0:0
-
1... loaded active plugged QEMU_DVD
-
ROM
.....(
省略
).....
vsftpd.service loaded active running Vsftpd ftp daemon
.....(
省略
).....
cups.socket
loaded failed failed CUPS Printing Service Sockets
.....(
省略
).....
LOAD = Reflects whether the unit definition was properly loaded.
ACTIVE = The high
-
level unit activation state, i.e. generalization of SUB.
SUB = The low
-
level unit activation stat
e, values depend on unit type.
141 loaded units listed. Pass
--
all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list
-
unit
-
files'.
#
列出的
目中,主要的意
是:
# UNIT
目的名
,包括各
unit
类别
(
展名
)
# LOAD
是否
被加
,默
systemctl
示的是有加
目而已喔!
# ACTIVE
:目前的
状态
与后
SUB
搭配!就是我
systemctl status
active
目!
# DESCRIPTION
详细
描述
# cups
½
有趣,因
为刚刚
被我
,所以
ACTIVE
竟然是
failed
的喔!被玩死了!
^_^
#
另外,
systemctl
都不加
参数
,其
实预设
就是
list
-
units
的意思!
范例二:列出所有已
unit
有哪些?
[root@study ~]#
systemctl list
-
unit
-
files
UNIT FILE STATE
proc
-
sys
-
fs
-
binfmt_misc.automount static
dev
-
hugepages.mount static
dev
-
mqueue.mount static
proc
-
fs
-
nfsd.mount
static
.....(
省略
).....
systemd
-
tmpfiles
-
clean.timer static
336 unit files listed.
使用
systemctl list-unit-files
会½系统上所有的服务通通列出来~而不像
list-units
½以
unit
分类作
大致的说明。
至于
STATE
状态就是前两个小½谈到的开机是否会加载的那个状态项目啰!主要有
enabled / disabled / mask / static
等等。