systemctl添加开机启动
我們對service和chkconfig兩個命令都不陌生,systemctl 是管制服務的主要工具, 它整合了chkconfig 與 service功能于一體。
systemctl is-enabled iptables.service
systemctl is-enabled servicename.service #查詢服務是否開機啟動
systemctl enable *.service #開機運行服務
systemctl disable *.service #取消開機運行
systemctl start *.service #啟動服務
systemctl stop *.service #停止服務
systemctl restart *.service #重啟服務
systemctl reload *.service #重新加載服務配置文件
systemctl status *.service #查詢服務運行狀態(tài)
systemctl --failed #顯示啟動失敗的服務
注:*代表某個服務的名字,如http的服務名為httpd
例如在CentOS?7 上安裝http
[root@CentOS7 ~]# yum -y install httpd
啟動服務(等同于service httpd start)
systemctl start httpd.service
停止服務(等同于service httpd stop)
systemctl stop httpd.service
重啟服務(等同于service httpd restart)
systemctl restart httpd.service
查看服務是否運行(等同于service httpd status)
systemctl status httpd.service
開機自啟動服務(等同于chkconfig httpd on)
systemctl enable httpd.service
開機時禁用服務(等同于chkconfig httpd on)
systemctl disable httpd.service
查看服務是否開機啟動 (等同于chkconfig --list)
??下一篇:linux上啟動tomcat遠程不能訪問
總結
以上是生活随笔為你收集整理的systemctl添加开机启动的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: SSH中后台传到前台一个信息集合,tr
- 下一篇: 关于获取客户端Mac地址