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