Centos7 查看自启动列表systemctl list-unit-files以及设置服务自启动


CentOS7查看自启列表命令

systemctl list-unit-files

 

执行结果:"enabled:自启动","disabled:未自启动"

只查看服务类型的开机启动

systemctl --type service list-unit-files

重启或者查看某个服务状态

systemctl restart abrtd.service 
systemctl status abrtd.service 

设置服务开机启动

 systemctl enable nginx.service //设置nginx开机启动
 systemctl enable php-fpm.service  //php-fpm开机启动

搜索指定状态的服务

systemctl list-unit-files | grep enabled  //搜索全部已启动的服务,enabled 启用;disabled 禁用。

搜索指定服务的状态

systemctl list-unit-files | grep nginx  //搜索 nginx 的开机启动状态

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM