在centos7后,系统服务的相关命令改为了systemctl,这里记录一下常用的使用方法
启动/关闭/重启 服务
1systemctl start/stop/restart ntpd.service查看服务状态
1systemctl status ntpd.service设置开机自启动
1systemctl enable ntpd.service禁止开机启动
1systemctl disable ntpd.service查看服务是否开机启动
1systemctl is-enabled ntpd.service查看启动失败的服务列表
1systemctl --failed搜索服务
1systemctl list-unit-files |grep ntpd