CentOS 7.0 systemctl使用說明

來源:互聯網
上載者:User

CentOS 7.0 systemctl使用說明
centos 7.0 引入了很多心得特性,感覺比較大的是sytemctl 命令的使用。

systemd使用方法:

systemd的服務管理程式

systemctl是最主要的工具。它融合 service 和chkconfig的功能於一體。你可以使用它永久性或只在當前會話中啟用/禁用服務。

下面命令用於列出正在啟動並執行服務或其他: systemctl

更多詳細資料請參考手冊頁(man systemctl)。systemd-cgls以樹形列出正在啟動並執行進程。它可以遞迴顯示給定控制組內容。詳情請參閱systemd-cgls手冊頁。

如何啟動/關閉、啟用/禁用服務?

運行一個服務:

systemctl start network.service 關閉網路服務:

systemctl stop network.service 重啟網路服務:

systemctl restart network.service

顯示一個服務(無論運行與否)的狀態: systemctl status network.service

在開機時啟用一個服務: systemctl enable network.service

在開機時禁用一個服務: systemctl disable network.service

查看服務開機是否啟動:systemctl is-enabled network.service;echo $? 或者是chkconfig
使用systemctl命令,要記住start,stop,restart,status,enable,disable,is-enabled。就可以很好的使用!

systemd查看開機自啟動的程式
相當於chkconfig --list
ls /etc/systemd/system/multi-user.target.wants/

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.