centos7添加、取消、查看开机启动项命令

Give light and people will find the way

1、查看开机启动项列表(enable表示开机启动,disabled表示开机不启动)

systemctl list-unit-files     //开机启动项多时,按空格翻页

 centos7添加、取消、查看开机启动项命令插图

有些centos7中装的服务,使用上述命令查不到,此时需要使用chkconfig查看:

chkconfig --list

centos7添加、取消、查看开机启动项命令插图1

2、过滤查看某个服务是否开机启动

systemctl list-unit-files |grep  xxxxxx

centos7添加、取消、查看开机启动项命令插图2

chkconfig --list |grep sshd

centos7添加、取消、查看开机启动项命令插图3

3、添加某个服务为开机自动启动

systemctl enable xxxxxxxx

centos7添加、取消、查看开机启动项命令插图4

某些服务可能不支持上面的命令,需要使用下面的命令添加
chkconfig --add xxxxxxx
chkconfig xxxxxx on

4、取消某个服务的开机启动

systemctl disable xxxxxxxx

centos7添加、取消、查看开机启动项命令插图5

使用chkconfig管理的服务需要使用下面的命令取消

chkconfig xxxxxx off
chkconfig --del xxxxxxx

Success is a competition with oneself

随机数:302304814815
本文来源于:https://www.fcblog.cn/post/33.html

    © 版权声明
    THE END
    喜欢就支持一下吧♡
    点赞0
    分享
    评论 抢沙发