Centos设置服务开机自启动方法

2014年12月30日22:19:24系统教程评论635

  在Centos系统后安装的服务,如pptpd等,安装后不会随系统自启动。手动启动服务后,如果后续遇到服务器重启,响应的服务无法自动运行。为了避免不必要的损失,我们需要将后安装的相应服务加入到开机自启动。加入开机自启动有以下两种方式: 文章源自堕落的鱼-https://www.duoluodeyu.com/969.html

一、修改 /etc/rc.d/rc.local 文章源自堕落的鱼-https://www.duoluodeyu.com/969.html

vi /etc/rc.d/rc.local
#添加以下命令
/usr/sbin/apachectl start
/etc/rc.d/init.d/mysqld start
/etc/rc.d/init.d/smb start
/usr/local/subversion/bin/svnserve -d

二、使用chkconfig设置服务启动级别 文章源自堕落的鱼-https://www.duoluodeyu.com/969.html

文章源自堕落的鱼-https://www.duoluodeyu.com/969.html

1、设置服务自启动 文章源自堕落的鱼-https://www.duoluodeyu.com/969.html

   chkconfig pptpd on 文章源自堕落的鱼-https://www.duoluodeyu.com/969.html

2、取消服务自启动 文章源自堕落的鱼-https://www.duoluodeyu.com/969.html

   chkconfig pptpd off 文章源自堕落的鱼-https://www.duoluodeyu.com/969.html

ps:本文以pptpd服务为例进行举例,其他服务请修改对应服务ID。文章源自堕落的鱼-https://www.duoluodeyu.com/969.html

匿名

发表评论

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定