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/