日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 运维知识 > linux >内容正文

linux

linux chkconfig 和 systemctl 区别 对比

發(fā)布時(shí)間:2025/1/21 linux 47 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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 httpd

chkconfig 和 systemctl 區(qū)別對(duì)比

任務(wù)舊指令新指令
使某服務(wù)自動(dòng)啟動(dòng)chkconfig --level 3 httpd onsystemctl enable httpd.service
使某服務(wù)不自動(dòng)啟動(dòng)chkconfig --level 3 httpd offsystemctl disable httpd.service
檢查服務(wù)狀態(tài)service httpd statussystemctl status httpd.service(服務(wù)詳細(xì)信息) / systemctl is-active httpd.service (僅顯示是否 Active)
加入自定義服務(wù)chkconfig --add testsystemctl load test.service
刪除服務(wù)chkconfig --del xxx停掉應(yīng)用,刪除相應(yīng)的配置文件
顯示所有已啟動(dòng)的服務(wù)chkconfig --listsystemctl list-units --type=service
啟動(dòng)某服務(wù)service httpd startsystemctl start httpd.service
停止某服務(wù)service httpd stopsystemctl stop httpd.service
重啟某服務(wù)service httpd restartsystemctl restart httpd.service

總結(jié)

以上是生活随笔為你收集整理的linux chkconfig 和 systemctl 区别 对比的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。