通過systemctl命令執(zhí)行對系統(tǒng)服務的操作
systemctl [OPTIONS...] COMMAND [NAME...]
例如啟動網(wǎng)絡服務
systemctl start NetworkManager
CentOS7有兩個網(wǎng)絡服務棚品,其中network是為了兼容之前的版本黎侈,可以關(guān)掉network嚷炉,只啟動NetworkManager
systemctl stop network
systemctl restart NetworkManager
設置服務的開機自啟動
設置自啟動
systemctl enable NetworkManager
取消自啟動
systemctl disable NetworkManager
查看服務的自啟動情況,enable
/disable
/static
,static
依賴于其他服務的服務,本身不考慮是否自啟動
systemctl list-unit-files
[root@linux ~]# 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
proc-sys-fs-binfmt_misc.mount static
run-vmblock\x2dfuse.mount disabled
sys-fs-fuse-connections.mount static
sys-kernel-config.mount static
sys-kernel-debug.mount static
tmp.mount disabled
var-lib-nfs-rpc_pipefs.mount static
brandbot.path disabled
cups.path enabled
systemd-ask-password-console.path static
防火墻服務是firewalld
,可用上面的命令進行停止/啟動/重啟/設置自啟動/取消自啟動
`