centos7中查看指定服务是否开机自动启动

 

以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

 。

 

posted @ 2023-08-04 21:54  小鲨鱼2018  阅读(356)  评论(0编辑  收藏  举报