国产宅男网站在线|亚洲A级性爱免费视频|亚洲中精品级在线|午夜福利AA毛

  • <dd id="gf5jf"><th id="gf5jf"></th></dd>

    <cite id="gf5jf"><label id="gf5jf"></label></cite>
  • <div id="gf5jf"><listing id="gf5jf"></listing></div>
    學習啦 > 學習電腦 > 操作系統(tǒng) > Linux教程 > linux systemctl命令詳解

    linux systemctl命令詳解

    時間: 佳洲1085 分享

    linux systemctl命令詳解

      systemctl命令是Linux下的一個命令,那么它具體語法是什么呢?下面由學習啦小編為大家整理了linux systemctl命令的相關知識,希望對大家有幫助!

      linux systemctl命令說明

      systemctl命令是系統(tǒng)服務管理器指令,它實際上將 service 和 chkconfig 這兩個命令組合到一起。

      linux systemctl命令格式

      systemctl is-enabled iptables.service #查詢服務是否開機啟動

      systemctl enable *.service #開機運行服務

      systemctl disable *.service #取消開機運行

      systemctl start *.service #啟動服務

      systemctl stop *.service #停止服務

      restart *.service #重啟服務

      systemctl reload *.service #重新加載服務配置文件

      systemctl status *.service #查詢服務運行狀態(tài)

      systemctl --failed #顯示啟動失敗的服務

      systemctl list-unit-files --type=service #列出所有服務(包括啟用的和禁用的)

      systemctl mask *.service #屏蔽(讓它不能啟動) s

      ystemctl unmask *.service #顯示服務

      linux systemctl命令實例

      1.啟動nfs服務

      systemctl start nfs-server.service

      2.設置開機自啟動

      systemctl enable nfs-server.service

      3.停止開機自啟動

      systemctl disable nfs-server.service

      4.查看服務當前狀態(tài)

      systemctl status nfs-server.service

      5.重新啟動某服務

      systemctl restart nfs-server.service

      6.查看所有已啟動的服務

      systemctl list -units --type=service

      7.開啟防火墻22端口

      iptables -I INPUT -p tcp --dport 22 -j accept

      如果仍然有問題,就可能是SELinux導致的

      關閉SElinux: 修改/etc/selinux/config文件中的SELINUX=””為disabled,然后重啟。

      徹底關閉防火墻:

      sudo systemctl status firewalld.service

      sudo systemctl stop firewalld.service

      sudo systemctl disable firewalld.service

    3582317