centos7的服务管理

时间:2021-06-22 22:14:00

1,启动服务(每条都可以)
systemctl start httpd
systemctl start httpd.service
service httpd start

2,停止服务
systemctl stop httpd
systemctl stop httpd.service
service httpd stop

3,重启服务
systemctl restart httpd
systemctl restart httpd.service
serivce httpd restart

4,查看服务运行状态
systemctl status httpd
systemctl status httpd.service
service httpd status

5,重新读取配置文件
systemctl reload httpd
systemctl reload httpd.service

6,设置服务为开机自启动
查看:systemctl is-enabled httpd
设置为自启动:systemctl enable httpd
关闭自启动: systemctl disalbe httpd

7,关机
systemctl poweroff
重启
systemctl reboot
待机
systemctl suspend