CentOS 7 0 systemctl使用說明

2021-08-19 10:46:06 字數 881 閱讀 8801

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

systemd使用方法:

systemd的服務管理程式

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

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

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

執行乙個服務:

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/

1

給主人留下些什麼吧!~~

CentOS7系統服務管理systemctl

發部落格的時候要注意,word有可能會把文中兩個減號 轉換成中文的 文中本就應該存在 如果有,那一定是被轉換了。centos7啟用了新的系統和服務管理器,採用systemctl命令代替了老版本的service和chkconfig。為了保持相容性,在centos7中,老版本的service和chkco...

CentOS7 的開機自啟動systemctl

centos7自啟項已不用chkconfig改為 systemctl list unit filessystemctl enable redis systemctl disable redis根據字尾名識別型別 1.service 定義系統服務的啟動 2.target定義了系統啟動級別的標籤,sys...

CentOS 7 0,啟用iptables防火牆

centos 7.0預設使用的是firewall作為防火牆,這裡改為iptables防火牆。1 關閉firewall systemctl stop firewalld.service 停止firewall systemctl disable firewalld.service 禁止firewall開...