linux chkconfig 和 systemctl 区别 对比
生活随笔
收集整理的這篇文章主要介紹了
linux chkconfig 和 systemctl 区别 对比
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
chkconfig命令
Copy主要用來更新(啟動或停止)和查詢系統服務(service)的運行級信息,用于維護/etc/rc[0-6].d目錄的命令行工具。chkconfig -–add httpd增加httpd服務chkconfig –-del httpd刪除httpd服務chkconfig –-list列出系統所有的服務啟動情況chkconfig –-list mysqld列出mysqld服務設置情況chkconfig –-level 35 mysqld on設定mysqld在等級3和5為開機運行服務(on表示開機啟動,off表示開機不啟動,reset指重置服務的啟動信息)chkconfig mysqld on設定mysqld在各等級為on,“各等級”包括2、3、4、5等級等級0表示:表示關機 等級1表示:單用戶模式 等級2表示:無網絡連接的多用戶命令行模式 等級3表示:有網絡連接的多用戶命令行模式 等級4表示:不可用 等級5表示:帶圖形界面的多用戶模式 等級6表示:重新啟動systemctl(代替chkconfig和service)
Copy在 Centos 中 systemctl 是設置系統服務(service)的命令,它融合之前service和chkconfig的功能于一體。 可以使用它永久性或只在當前會話中啟用/禁用服務。啟動、停止、重啟、重載服務systemctl start name.servicesystemctl stop name.servicesystemctl restart name.servicesystemctl reload name.service查看某個服務(單元)的狀態systemctl status name.service激活/禁止自動啟動systemctl enable httpd.servicesystemctl disable httpd.service殺死服務systemctl kill httpdchkconfig 和 systemctl 區別對比
| 使某服務自動啟動 | chkconfig --level 3 httpd on | systemctl enable httpd.service |
| 使某服務不自動啟動 | chkconfig --level 3 httpd off | systemctl disable httpd.service |
| 檢查服務狀態 | service httpd status | systemctl status httpd.service(服務詳細信息) / systemctl is-active httpd.service (僅顯示是否 Active) |
| 加入自定義服務 | chkconfig --add test | systemctl load test.service |
| 刪除服務 | chkconfig --del xxx | 停掉應用,刪除相應的配置文件 |
| 顯示所有已啟動的服務 | chkconfig --list | systemctl list-units --type=service |
| 啟動某服務 | service httpd start | systemctl start httpd.service |
| 停止某服務 | service httpd stop | systemctl stop httpd.service |
| 重啟某服務 | service httpd restart | systemctl restart httpd.service |
總結
以上是生活随笔為你收集整理的linux chkconfig 和 systemctl 区别 对比的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: linux安装minikube(Ubun
- 下一篇: Livy安装使用(Spark rest接