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

自动启动设置有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 #开机不启动

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容