在 CentOS 7 中检查服务自动启动是启用或禁用状态
[root@jasonsong ~]# systemctl is-enabled nginx
在 CentOS 7 中禁用服务自动启动
[root@jasonsong ~]# systemctl disable nginx
在 CentOS 7 中启用服务自动启动
[root@jasonsong ~]# systemctl enable nginx
在 CentOS 6 中检查服务自动启动是启用或禁用状态(没有添加显示为空)
[root@jasonsong ~]# chkconfig --list | grep nginx
在 CentOS 6 中添加服务
[root@jasonsong ~]# chkconfig --add nginx
在 CentOS 6 中禁用服务自动启动
[root@jasonsong ~]# chkconfig nginx off
在 CentOS 6 中启用服务自动启动
[root@jasonsong ~]# chkconfig nginx on