Centos7 设置 查看 开机启动项
warning:
这篇文章距离上次修改已过590天,其中的内容可能已经有所变动。
1.查看开机自启项
centos7自启项已不用chkconfig改为:
systemctl list-unit-files
左边是服务名称,右边是状态,enabled是开机启动,disabled是开机不启动的。

还可以使用grep过滤,例如:
systemctl list-unit-files | grep enabled #仅查看自启的
systemctl list-unit-files | disabled #进查看不自启的
2.设置/禁用开机自启项
例如:
systemctl enable mysqld #开机启动mysql
systemctl disable mysqld #禁止开机启动mysql