linux开机启动项管理
来源:互联网 发布:cf手游剑齿虎优化 编辑:程序博客网 时间:2024/06/08 16:13
linux下很多服务都是默认启动,导致开机变慢
可以使用chkconfig命令进行管理,没用此命令可以使用apt-get install chkconfig安装
使用命令:
chkconfig
可以显示所有服务的开启情况
显示帮助:
chkconfig --help
帮助信息:
chkconfig -A|--allservices (together with -l: show all services)显示所有服务 chkconfig -t|--terse [names] (shows the links)和chkconfig输出相同 chkconfig -e|--edit [names] (configure services)使用编辑器编辑 chkconfig -s|--set [name state]... (configure services)设置 chkconfig -l|--list [--deps] [names] (shows the links)显示列表 chkconfig -c|--check name [state] (check state)查看状态 chkconfig -a|--add [names] (runs insserv)添加 chkconfig -d|--del [names] (runs insserv -r)删除,不使用chkconfig管理 chkconfig -h|--help (print usage)帮助信息 chkconfig -f|--force ... (call insserv with -f) chkconfig [name] same as chkconfig -t chkconfig name state... same as chkconfig -s name state chkconfig --root=<root> ... use <root> as the root file system
语法:
chkconfig [--add][--del][--list][系统服务]
或 chkconfig [--level <等级代号>][系统服务][on/off/reset]
等级系统:
--level<等级代号> 指定读系统服务要在哪一个执行等级中开启或关毕。 等级0表示:表示关机 等级1表示:单用户模式 等级2表示:无网络连接的多用户命令行模式 等级3表示:有网络连接的多用户命令行模式 等级4表示:不可用 等级5表示:带图形界面的多用户模式 等级6表示:重新启动
使用范例:(来自:http://www.cnblogs.com/panjun-Donet/archive/2010/08/10/1796873.html)
chkconfig --list #列出所有的系统服务chkconfig --add httpd #增加httpd服务chkconfig --del httpd #删除httpd服务chkconfig --level httpd 2345 on #设置httpd在运行级别为2、3、4、5的情况下都是on(开启)的状态chkconfig --list #列出系统所有的服务启动情况chkconfig --list mysqld #列出mysqld服务设置情况chkconfig --level 35 mysqld on #设定mysqld在等级3和5为开机运行服务,--level 35表示操作只在等级3和5执行,on表示启动,off表示关闭chkconfig mysqld on #设定mysqld在各等级为on,“各等级”包括2、3、4、5等级
如何增加一个服务: 1.服务脚本必须存放在/etc/ini.d/目录下; 2.chkconfig --add servicename 在chkconfig工具服务列表中增加此服务,此时服务会被在/etc/rc.d/rcN.d中赋予K/S入口了; 3.chkconfig --level 35 mysqld on 修改服务的默认启动等级。
原文:http://www.sxwen.cn/archives/314
阅读全文
0 0
- linux开机启动项管理
- 管理开机启动项
- Linux-6-开机启动管理
- linux开机启动项
- Linux管理默认系统开机启动服务
- linux开机自启动项
- linux添加开机启动项
- linux添加开机启动项
- Linux设置开机启动项
- linux设置开机启动项
- Linux添加开机启动项
- linux精简开机启动项
- Ubuntu管理开机启动项(服务)
- Ubuntu管理开机启动项(服务)
- 【Windows7系统开机启动项管理实用技巧】
- ubuntu mint 开机启动项管理
- Ubuntu管理开机启动项(服务)
- Ubuntu管理开机启动项(服务)
- Java简单的接口和ActionEven事件练习
- 在eclipse中安装properties插件PropertiesEditor及设置(附图),ASCII码转换成中文 安装成功后ASCII还是不能转换成中文的,原因是设置里面没有把编码设置为utf8的
- poj3114 Countries in War 强连通缩点+最短路
- File类,对文件夹和文件周边信息的操作。
- ListView控件的理解——自洽理论
- linux开机启动项管理
- 5.3总结
- 自定义网页头部前面小图标
- poj算法-使用C语言在VC++6.0实现poj1004
- Effective STL学习笔记-条款30
- MySQL多个数据表关系
- 6. 同步化器(Synchronizers)
- 网站开发进阶(十二)JS实现打印功能(包括打印预览、打印设置等)
- ctf隐写篇