1.启动/停止/重启服务
systemctl start xxxx
systemctl stop xxxx
2.把服务设置为开机启动/取消开机启动
systemctl enable xxxx.service
systemctl disable xxxx.service
3.打开/关闭防火墙服务
systemctl status firewalld
systemctl start firewalld.service(.service后缀可以省略)
systemctl stop firewalld.service
4.检测系统安装了某服务
systemctl list-unit-files| grep xxxx
disabled表示禁止开机自启动,enabled表示允许开机自启动,static表示与其他服务相关联,不能单独设置。
本课程一直关闭防火墙。