免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1771 | 回复: 0
打印 上一主题 下一主题

[网络管理] ubuntu 取消 apache及mysql等自启动 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-12-21 09:58 |只看该作者 |倒序浏览
1. 装个 sysv-conf-rc

2. sudo update-rc.d -f mysql remove 删除mysql随机器启动的服务
sudo update-rc.d -f apache2 remove 删除apache2随机器启动的服务

3.查看/etc/rc2.d/里面的apache和mysql启动脚本,通常都是两个阿拉伯数字后再接一个英文字母,再加脚本名称。英文字母是S的都是会自动启动的,K则相反。所以只要找到apache和mysql的启动脚本,把S改成K就可以了

转载自:http://www.net527.cn/a/caozuoxitong/Linux/2011/0203/16362.html



对于第一步,在我的机器上好像不需要,我也没仔细研究sysv-conf-rc是个什么工具。

update-rc.d这个命令可能在安装好系统后就自带有这个命令,我参照步骤2的说法尝试做了一下

然后打开/etc/rc2.d目录下面的文件,没有找到K开头的跟apache有关的启动脚本,难道是执行步骤2中的命令后它会自动修改还是神马??

不太了解~~~



另外/etc/rc2.d目录下面还有一个README文件,打开它之后其实什么都一目了然了~~

The scripts in this directory are executed each time the system enters
this runlevel.

The scripts are all symbolic links whose targets are located in
/etc/init.d/ .

To disable a service in this runlevel, rename its script in this
directory so that the new name begins with a 'K' and a two-digit
number, and run 'update-rc.d script defaults' to reorder the scripts
according to dependencies.  A warning about the current runlevels
being enabled not matching the LSB header in the init.d script will be
printed.  To re-enable the service, rename the script back to its
original name beginning with 'S' and run update-rc.d again.

For a more information see /etc/init.d/README.

http://hi.baidu.com/yfnick/blog/ ... a052b18326acd0.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP