debian开机启动管理
debian开机启动管理(转文)
linux下,services的启动、停止等通常是通过/etc/init.d的目录下的脚本来控制的。
在启动或改变运行级别是在/etc/rcX.d中来搜索脚本。其中X是运行级别。
比如Apache2,安装完成后,默认或启动。比如我安装了vagrant的LMPA的box。需要禁止掉自启动,就需要禁止掉这个服务,然后在需要的时候使用
/usr/sbin/apachectl start #/etc/init.d/apache2 start
在debian中使用 update-rc.d命令来实现
update-rc.d [-n] [-f] <basename> remove
update-rc.d [-n] <basename> defaults [NN | SS KK]
update-rc.d [-n] <basename> start|stop NN runlvl [runlvl] [...] .
update-rc.d [-n] <basename> disable|enable [S|2|3|4|5]
-n: not really
-f: force
删除服务
update-rc.d -f apache2 remove # -f 为强制删除
添加服务
update-rc.d apache2 defaults
并且可以指定该服务的启动顺序:
update-rc.d apache2 defaults 90
还可以更详细的控制start与kill顺序:
update-rc.d apache2 defaults 20 80
其中前面的20是start时的运行顺序级别,80为kill时的级别。也可以写成:
update-rc.d apache2 start 20 2 3 4 5 . stop 80 0 1 6 .
其中0~6为运行级别。 update-rc.d命令不仅适用Linux服务,编写的脚本同样可以用这个命令设为开机自动运行
在debian6中使用update-rc.d会报错,如下:
update-rc.d: using dependency based boot sequencing
可以使用 insserv 命令来代替 update-rc.d
insserv [<options>] [init_script|init_directory]
Available options:
-h, --help This help.
-r, --remove Remove the listed scripts from all runlevels.
-f, --force Ignore if a required service is missed.
-v, --verbose Provide information on what is being done.
-p <path>, --path <path> Path to replace /etc/init.d.
-o <path>, --override <path> Path to replace /etc/insserv/overrides.
-c <config>, --config <config> Path to config file.
-n, --dryrun Do not change the system, only talk about it.
-d, --default Use default runlevels a defined in the scripts
比如
insserv -r apache2
debian开机启动管理的更多相关文章
- 【转】Linux开机启动管理---systemd使用
常用命令 使某服务自动启动 systemctl enable httpd.service 使某服务不自动启动 systemctl disable httpd.service 检查服务状态 syste ...
- CentOS7开机启动管理systemd简介及使用
systemd提供更优秀的框架以表示系统服务间的依赖关系实现系统初始化时服务的并行启动,同时达到降低Shell的系统开销的效果systemd的目标是:尽可能启动更少进程:尽可能将更多进程并行启动.sy ...
- (十八)Linux开机启动管理---systemd使用
常用命令 使某服务自动启动 systemctl enable httpd.service 使某服务不自动启动 systemctl disable httpd.service 检查服务状态 system ...
- centos7 开机启动管理
查看开机启动项 ls /etc/systemd/system/multi-user.target.wants/ 设置开机启动 systemctl enable mongodb.service
- (转)CentOS下开机启动查看管理命令:chkconfig用法
CentOS下开机启动查看管理命令:chkconfig用法 CentOS下开机启动查看管理的命令是:chkconfig 1. 开机启动列表查看: chkconfig --list 说明 ...
- Debian - 设置MYSQL开机启动
设置MYSQL 首先拷贝mysql.server到/etc/init.d目录下命名为mysql # cp /自己的安装目录/mysql/share/mysql/mysql.server /etc/in ...
- Centos7.x:开机启动服务的配置和管理
一.开机启动服务的配置 1.创建服务配置(权限754) vim /usr/lib/systemd/system/nginx.service 文件内容解释 [Unit]:服务的说明Description ...
- Virtualbox开机启动,service命令管理
#!/bin/bash#chkconfig:235 80 20#description:start or stop vbox#Author:Qty~20180502#OS:RedHatEnterpri ...
- debian 9 开机启动
由于某些软件并没有增加开启启动的服务,很多时候需要手工添加,一般我们都是推荐添加命令到 /etc/rc.local 文件,但是 Debian 9 默认不带 /etc/rc.local 文件,而 rc. ...
随机推荐
- EF CodeFirst增删改查之‘CRUD’
最近悟出来一个道理,在这儿分享给大家:学历代表你的过去,能力代表你的现在,学习代表你的将来. 十年河东十年河西,莫欺少年穷 学无止境,精益求精 本篇旨在学习EF增删改查四大操作 上一节讲述了EF ...
- delphi的webBrowser操作HTML研究
测试例子: 外网电脑D:\TEST\delphiTest\webbrowsetest 参考文档: delphi 操作WebBrowser 元素值 http://hi.baidu.com/kinglik ...
- 【转】PowerShell入门(四):如何高效地使用交互式运行环境?
转至:http://www.cnblogs.com/ceachy/archive/2013/02/05/PowerShell_Interacting_Environment.html 在开始关于脚本. ...
- TI CC2541的红外控制
整整一个礼拜, 整了...大约40个小时吧, 最少.. 下面是结果, 只能做一个delay延时.: unsigned char Time;unsigned char IrValue[6];#pragm ...
- JavaScript encodeURI(), decodeURI(), encodeURIComponent(), decodeURIComponent()
URI: Uniform Resource Identifier encodeURI() And decodeURI() The encodeURI() function is used to en ...
- html5 canvas 笔记五(合成与裁剪)
组合 Compositing globalCompositeOperation syntax: globalCompositeOperation = type 注意:下面所有例子中,蓝色方块是先绘制的 ...
- 使用Netty收发二进制报文问题记
1.java二进制编解码 byteBuffer.flip() byteBuffer.getInt() 与 byteBuf.getInt(11) 2.粘包拆包问题 LengthFieldBasedFra ...
- 如何在Linux中查看所有正在运行的进程
如何在Linux中查看所有正在运行的进程 FROM:http://os.51cto.com/art/201101/244090.htm 进程是一个其中运行着一个或多个线程的地址空间和这些线程所需要的系 ...
- CentOS 更改yum源与更新系统
FROM:http://www.cnblogs.com/lightnear/archive/2012/10/03/2710952.html [1] 首先备份/etc/yum.repos.d/CentO ...
- 游戏引擎PushButtonEngine简介
PushButtonEngine是一个开源的模块化游戏引擎,你可以通过https://github.com/PushButtonLabs/PushButtonEngine得到其代码和相关文档.下面我将 ...