亚洲欧洲国产欧美一区精品,激情五月亚洲色五月,最新精品国偷自产在线婷婷,欧美婷婷丁香五月天社区

      考試首頁 | 考試用書 | 培訓課程 | 模擬考場 | 考試論壇  
        當前位置:Linux認證 > 紅帽認證 > 紅帽認證輔導 > 文章內容
        

      RHCE7認證學習筆記:控制服務和后臺進程

      來源:Linux社區(qū) [ 2016年2月13日 ] 【

      1、控制服務(services and daemons)

      RHEL7以前的版本控制服務使用service XX start|stop|status:
      [root@linuxidc ~]# service sshd status

      RHEL7控制服務使用systemctl start|stop|status|restart  XX服務,查看服務的當前運行狀態(tài)使用is-active:
      [root@linuxidc ~]# systemctl status sshd

      [root@linuxidc ~]# systemctl is-active sshd
      active

      [root@linuxidc ~]# systemctl sart|stop|restart sshd

      查看某項服務是否會開機自動啟動使用is-enable,相對應的是disable:
      [root@linuxidc ~]# systemctl is-enabled sshd
      enabled

          禁用某項服務使用mask,相對應的是unmask:

          下面總結一下systemctl命令常用控制服務的選項:

        start [NAME...]                Start (activate) one or more units 啟動服務
        stop [NAME...]                  Stop (deactivate) one or more units 停止服務
        reload [NAME...]                Reload one or more units 重新加載
        restart [NAME...]              Start or restart one or more units 重新啟動
       
        kill [NAME...]                  Send signal to processes of a unit 殺死進程
        is-active [NAME...]            Check whether units are active 是否啟動
        is-failed [NAME...]            Check whether units are failed 是否失敗
        status [NAME...|PID...]        Show runtime status of one or more units 狀態(tài)

        enable [NAME...]                Enable one or more unit files 開機啟動
        disable [NAME...]              Disable one or more unit files 開機不啟動
        reenable [NAME...]              Reenable one or more unit files 重新設置開機啟動

       is-enabled [NAME...]            Check whether unit files are enabled 是否開機啟動
        mask [NAME...]                  Mask one or more units 禁用服務
        unmask [NAME...]                Unmask one or more units 不禁用服務

      查看系統(tǒng)所有服務:systemctl list-units-all或system ctl list-units-files:
      [root@linuxidc ~]# systemctl list-units

      [root@linuxidc ~]# systemctl list-unit-files

      加上type選項可以查看所有服務:
      [root@linuxidc ~]# systemctl list-unit-files --type service
      UNIT FILE                                  STATE   
      abrt-ccpp.service                          enabled 
      abrt-oops.service                          enabled 
      abrt-pstoreoops.service                    disabled

      將考試網添加到收藏夾 | 每次上網自動訪問考試網 | 復制本頁地址,傳給QQ/MSN上的好友 | 申請鏈接 | 意見留言 TOP
      關于本站  網站聲明  廣告服務  聯(lián)系方式  站內導航  考試論壇
      Copyright © 2007-2013 中華考試網(Examw.com) All Rights Reserved