2023年12月19日发(作者:)

任务 旧指令 新指令

systemctl enable e

使某服务chkconfig --level 3

自动启动 httpd on

使某服务不自动启chkconfig --level 3 httpd off

systemctl disable e

systemctl status e

检查服务状态

service httpd status

(服务详细信息)

systemctl is-active e

(仅显示是否 Active)

显示所有已启动的chkconfig --list

服务

启动某服务

停止某服务

重启某服务

service httpd start

systemctl list-units

--type=service

systemctl start e

service httpd stop systemctl stop e

service httpd restart systemctl restart e

启动nginx服务

systemctl start e

设置开机自启动

systemctl enable e

停止开机自启动

systemctl disable e

查看服务当前状态

systemctl status e

重新启动服务

systemctl restart e

查看所有已启动的服务

systemctl list-units --type=service