美文网首页
CentOS 7 自动启动设置的几种方式

CentOS 7 自动启动设置的几种方式

作者: 那五常 | 来源:发表于2017-09-30 11:40 被阅读0次

    自动启动设置有setup 、rc.local 、chkconfig和systemctl等几种方式:

    一、setup

    可以在shell图形终端里面配置的命令,去service里选择

    二、rc.local

    把启动命令放到/etc/rc.d/rc.local文件里,如:

    #sshd

    /usr/local/sbin/sshd

    #proftpd

    /usr/local/sbin/proftpd

    #apache

    /home/apache/bin/apachectl start

    #mysql

    /home/mysql/bin/safe_mysqld --port=3306 &

    #start oracle8i listener first

    su - oracle -c 'lsnrctl start'

    #start oracle8i

    su - oracle -c 'dbstart'

    三、chkconfig

    chkconfig --list    显示开机可以自动启动的服务

    chkconfig --add *** 添加开机自动启动***服务

    chkconfig --del ***   删除开机自动启动***服务

    四、systemctl

    systemctl enable httpd.service #开机启动

    systemctl disable httpd.service #开机不启动

    相关文章

      网友评论

          本文标题:CentOS 7 自动启动设置的几种方式

          本文链接:https://www.haomeiwen.com/subject/ukpgextx.html