這篇文章主要介紹“CentOS7中systemctl命令的用法”,在日常操作中,相信很多人在CentOS7中systemctl命令的用法問題上存在疑惑,小編查閱了各式資料,整理出簡單好用的操作方法,希望對(duì)大家解答”CentOS7中systemctl命令的用法”的疑惑有所幫助!接下來,請(qǐng)跟著小編一起來學(xué)習(xí)吧!
站在用戶的角度思考問題,與客戶深入溝通,找到橋西網(wǎng)站設(shè)計(jì)與橋西網(wǎng)站推廣的解決方案,憑借多年的經(jīng)驗(yàn),讓設(shè)計(jì)與互聯(lián)網(wǎng)技術(shù)結(jié)合,創(chuàng)造個(gè)性化、用戶體驗(yàn)好的作品,建站類型包括:網(wǎng)站制作、做網(wǎng)站、企業(yè)官網(wǎng)、英文網(wǎng)站、手機(jī)端網(wǎng)站、網(wǎng)站推廣、國際域名空間、網(wǎng)站空間、企業(yè)郵箱。業(yè)務(wù)覆蓋橋西地區(qū)。
Linux Systemctl是一個(gè)系統(tǒng)管理守護(hù)進(jìn)程、工具和庫的集合,用于取代System V、service和chkconfig命令,初始進(jìn)程主要負(fù)責(zé)控制systemd系統(tǒng)和服務(wù)管理器。通過Systemctl –help可以看到該命令主要分為:查詢或發(fā)送控制命令給systemd服務(wù),管理單元服務(wù)的命令,服務(wù)文件的相關(guān)命令,任務(wù)、環(huán)境、快照相關(guān)命令,systemd服務(wù)的配置重載,系統(tǒng)開機(jī)關(guān)機(jī)相關(guān)的命令。
systemctl list-unit-files
systemctl list-units
systemctl –failed
systemctl is-enabled crond.service
systemctl list-unit-files –type=service
systemctl start httpd.service systemctl restart httpd.service systemctl stop httpd.service systemctl reload httpd.service systemctl status httpd.service
注意:當(dāng)我們使用systemctl的start,restart,stop和reload命令時(shí),終端不會(huì)輸出任何內(nèi)容,只有status命令可以打印輸出。
systemctl is-active mysql.service systemctl enable mysql.service systemctl disable mysql.service
systemctl mask ntpdate.service ln -s /dev/null /etc/systemd/system/ntpdate.service systemctl unmask ntpdate.service rm /etc/systemd/system/ntpdate.service
systemctl kill crond
systemctl list-unit-files –type=mount
systemctl start tmp.mount systemctl stop tmp.mount systemctl restart tmp.mount systemctl reload tmp.mount systemctl status tmp.mount
systemctl is-active tmp.mount systemctl enable tmp.mount systemctl disable tmp.mount
systemctl mask tmp.mount ln -s /dev/null /etc/systemd/system/tmp.mount systemctl unmask tmp.mount rm /etc/systemd/system/tmp.mount
systemctl list-unit-files –type=socket
systemctl show mysql
systemctl list-dependencies httpd.service
systemctl rescue
systemctl emergency
systemctl get-default
systemctl isolate runlevel5.target
或
systemctl isolate graphical.target
systemctl isolate runlevel3.target
或
systemctl isolate multiuser.target
systemctl set-default runlevel3.target systemctl set-default runlevel5.target
systemctl reboot systemctl halt systemctl suspend systemctl hibernate systemctl hybrid-sleep
對(duì)于不知運(yùn)行等級(jí)為何物的人,說明如下。
Runlevel 0 : 關(guān)閉系統(tǒng) Runlevel 1 : 救援,維護(hù)模式 Runlevel 3 : 多用戶,無圖形系統(tǒng) Runlevel 4 : 多用戶,無圖形系統(tǒng) Runlevel 5 : 多用戶,圖形化系統(tǒng) Runlevel 6 : 關(guān)閉并重啟機(jī)器
到此,關(guān)于“CentOS7中systemctl命令的用法”的學(xué)習(xí)就結(jié)束了,希望能夠解決大家的疑惑。理論與實(shí)踐的搭配能更好的幫助大家學(xué)習(xí),快去試試吧!若想繼續(xù)學(xué)習(xí)更多相關(guān)知識(shí),請(qǐng)繼續(xù)關(guān)注創(chuàng)新互聯(lián)網(wǎng)站,小編會(huì)繼續(xù)努力為大家?guī)砀鄬?shí)用的文章!