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

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

CentOS 7 / RHEL 7 systemd 指令

發布時間:2023/12/2 编程问答 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 CentOS 7 / RHEL 7 systemd 指令 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.


CentOS 7?已經切換到 systemd,系統指令也有所變化。之前用于啟動、重啟、停止各種服務的service?作為向后兼容的指令還能使用,但是將來可能會消失。同時,chkconfig?也改成了systemctl?了。這里列舉了一些常用的對應于?service?和?chkconfig?的新的?systemctl指令。

在目前的 CentOS 7(或 RHEL 7)系統中,依然可以使用?service?指令。例如,

[root@localhost ~]# service network restart Restarting network (via systemctl): [ OK ][root@localhost ~]# service httpd restart Redirecting to /bin/systemctl restart httpd.service[root@localhost ~]# service sshd restart Redirecting to /bin/systemctl restart sshd.service

但是系統會自動重定向該指令到新的指令?/bin/systemctl?來執行,并給出提示。

是時候切換到新的指令格式了,直接使用?systemctl?吧。這個指令的意思就是 system contrl。下面是一些常用的例子:

啟動服務:

systemctl start httpd

停止服務:

systemctl stop httpd

重啟服務(先停止,后啟動):

systemctl restart httpd

重新加載(使用新的配置文件):

systemctl reload httpd

顯示服務狀態:

systemctl status httpd

與此同時,之前用于設定系統啟動時自動運行某服務的指令?chkconfig?也改了,還是用systemctl。

chkconfig service on

改成了,

systemctl enable httpd chkconfig service off

改成了,

systemctl disable httpd

檢查服務狀態的

chkconfig service

改成了,

systemctl is-enabled httpd

列舉出所有服務的指令,

chkconfig –list

改成了,

systemctl list-unit-files --type=service

以前能指定服務 runlevel 的 –levels 也沒有了。慢慢適應吧。?

本文發表于水景一頁。永久鏈接:<https://cnzhx.net/blog/centos-7-rhel-7-systemd-commands/>。轉載請保留此信息及相應鏈接。

總結

以上是生活随笔為你收集整理的CentOS 7 / RHEL 7 systemd 指令的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。