1,查看自啟動服務?
systemctl list-unit-files --type service |grep enabled
2,查看某服務的開機啟動狀態?
systemctl list-unit-files --type service |grep service_name
3,啟動(關閉,重啟,查看)某個服務?
(centos6系統):service service_name (start|stop|restart|status)
(centos7系統):systemctl (start|stop|restart|status) service_name
注:centos7系統兼容centos6的啟動命令(即7中可以使用6的命令)。
4,設置開機啟動或者關閉某個服務?
(centos6系統):
開機啟動:chkconfig --add service_name 或者 chkconfig service_name on
開機關閉:chkconfig --del service_name 或者 chkconfig service_name off
(centos7系統):
開機啟動:systemctl enable service_name
開機關閉:systemctl disable service_name
