以ntpd服务为例
001、查看ntpd服务的的当前状态
[root@PC1 home]# systemctl list-unit-files | grep "ntpd" ## 查看ntpd服务 ntpd.service disabled ntpdate.service disabled
002、设置ntpd服务开机自动启动
[root@PC1 home]# systemctl enable ntpd ## 设置ntpd服务开机自动启动 Created symlink from /etc/systemd/system/multi-user.target.wants/ntpd.service to /usr/lib/systemd/system/ntpd.service.
003、查看ntpd是否开机自动启动
[root@PC1 home]# systemctl list-unit-files | grep "ntpd" ntpd.service enabled ## 已经是开机自动启动 ntpdate.service disabled
。
标签:服务,查看,service,启动,centos7,自动,开机,ntpd From: https://www.cnblogs.com/liujiaxin2018/p/17607140.html