CentOS7服务管理(重启,停止,自动启动命令)
生活随笔
收集整理的這篇文章主要介紹了
CentOS7服务管理(重启,停止,自动启动命令)
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
我們對service和chkconfig兩個命令都不陌生,systemctl 是管制服務(wù)的主要工具, 它整合了chkconfig 與 service功能于一體。
- systemctl is-enabled iptables.service
- systemctl is-enabled servicename.service #查詢服務(wù)是否開機(jī)啟動
- systemctl enable *.service #開機(jī)運(yùn)行服務(wù)
- systemctl disable *.service #取消開機(jī)運(yùn)行
- systemctl start *.service #啟動服務(wù)
- systemctl stop *.service #停止服務(wù)
- systemctl restart *.service #重啟服務(wù)
- systemctl reload *.service #重新加載服務(wù)配置文件
- systemctl status *.service #查詢服務(wù)運(yùn)行狀態(tài)
- systemctl --failed #顯示啟動失敗的服務(wù)
舉例:ssh服務(wù)
-
查看狀態(tài):
-
systemctl status sshd.service
-
- 啟動服務(wù):
-
systemctl start sshd.service
-
- 重啟服務(wù):
- systemctl restart sshd.service
- 開機(jī)自啟:
- systemctl enable sshd.service
總結(jié)
以上是生活随笔為你收集整理的CentOS7服务管理(重启,停止,自动启动命令)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: linux 查找某目录下包含关键字内容的
- 下一篇: Linux的chattr与lsattr命