centos7重新加载服务的命令_CentOS7 从查看、启动、停止服务说起systemctl
執(zhí)行命令“systemctl status 服務(wù)名.service”可查看服務(wù)的運(yùn)行狀態(tài),其中服務(wù)名后的.service 可以省略,這是CenOS7以后采用systemd作為初始化進(jìn)程后產(chǎn)生的變化。
Systemctl是一個(gè)systemd工具,主要負(fù)責(zé)控制systemd系統(tǒng)和服務(wù)管理器。
Systemd是一個(gè)系統(tǒng)管理守護(hù)進(jìn)程、工具和庫(kù)的集合,用于取代System V初始進(jìn)程。Systemd的功能是用于集中管理和配置Linux系統(tǒng)。
以網(wǎng)絡(luò)服務(wù)network.service為例:
1、查看服務(wù)狀態(tài)
systemctl status network.service
2、控制服務(wù)
啟動(dòng)服務(wù)
systemctl start network.service
重啟服務(wù)
systemctl restart network.service
停止服務(wù)
systemctl stop network.service
開機(jī)啟動(dòng)服務(wù)
systemctl enable network.servic
停止開機(jī)啟動(dòng)
systemctl disable network.servic
3、查找所有或者某個(gè)服務(wù)
systemctl list-units --type=service | grep network
4、Systemctl接受服務(wù)(.service),掛載點(diǎn)(.mount),套接口(.socket)和設(shè)備(.device)作為單元。
列出所有可用單元
systemctl list-unit-files
列出所有運(yùn)行中單元
systemctl list-units
列出所有失敗單元
systemctl --failed
5、使用systemctl命令殺死服務(wù)
systemctl kill network.service
6、列出所有系統(tǒng)掛載點(diǎn)
systemctl list-unit-files --type=mount
UNIT FILE STATE
dev-hugepages.mount static
dev-mqueue.mount static
proc-sys-fs-binfmt_misc.mount static
sys-fs-fuse-connections.mount static
sys-kernel-config.mount static
sys-kernel-debug.mount static
tmp.mount disabled
7、掛載、卸載、重新掛載、重載系統(tǒng)掛載點(diǎn)并檢查系統(tǒng)中掛載點(diǎn)狀態(tài)
systemctl start tmp.mount
systemctl stop tmp.mount
systemctl restart tmp.mount
systemctl reload tmp.mount
systemctl status tmp.mount
總結(jié)
以上是生活随笔為你收集整理的centos7重新加载服务的命令_CentOS7 从查看、启动、停止服务说起systemctl的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: Django 笔记5 -- 数据库
- 下一篇: c语言用栈编写数制转换程序,数制转换-栈