Chinaunix首页 | 论坛 | 博客
  • 博客访问: 19743077
  • 博文数量: 679
  • 博客积分: 10495
  • 博客等级: 上将
  • 技术积分: 9308
  • 用 户 组: 普通用户
  • 注册时间: 2006-07-18 10:51
文章分类

全部博文(679)

文章存档

2012年(5)

2011年(38)

2010年(86)

2009年(145)

2008年(170)

2007年(165)

2006年(89)

分类: LINUX

2007-11-23 11:02:29

chkconfig           Linux and Unix 命令手册

本命令手册以实用,简洁为原则,对于已经消化的内容,不附加详细的注解。

磁针石

联系方式: QQ:37391319 gmail and gtalk: xurongzhong@gmail.com

参考资料

《鸟哥的 Linux 私房菜》之 “

Red Hat Enterprise Linux ES release 4 (Nahant Update 3) chkconfig 命令参考

功能

chkconfig - updates and queries runlevel information for system services

此命令为liinux 独有

语法

       chkconfig --list [name]

       chkconfig --add name

       chkconfig --del name

       chkconfig [--level levels] name

       chkconfig [--level levels] name

常用用法

* 范例一:列出目前系统上面所有被 chkconfig 管理的服务

[root@linux ~]# chkconfig --list |more

 

*范例二:显示出目前在 run level 3 为启动的服务

[root@linux ~]# chkconfig --list | grep '3:on'

 

*范例三:让 atd 这个服务在 run level 3, 4, 5 时启动:

[root@linux ~]# chkconfig --level 345 atd on

 

命令参考

     关闭Linux系统下不必要的服务

 

 

chkconfig --list 显示。

chkconfig [service] off 关闭其中一个服务。

守候进程名字功能对照表。

amd:自动安装NFS(网络文件系统)守侯进程。

apmd:高级电源管理。

Arpwatch:记录日志并构建一个在LAN接口上看到的以太网地址和IP地址对数据库。

Autofs:自动安装管理进程automount,与NFS相关,依赖于NIS

Bootparamd:引导参数服务器,为LAN上的无盘工作站提供引导所需的相关信息。

crondLinux下的计划任务。

Dhcpd:启动一个DHCP(动态IP地址分配)服务器。

Gated:网关路由守候进程,使用动态的OSPF路由选择协议。

HttpdWEB服务器。

Inetd:支持多种网络服务的核心守候程序。

InndUsenet新闻服务器。

Linuxconf:允许使用本地WEB服务器作为用户接口来配置机器。

Lpd:打印服务器。

Mars-nwemars-nwe文件和用于Novell的打印服务器。

McservMidnight命令文件服务器。

namedDNS服务器。

netfs:安装NFSSambaNetWare网络文件系统。

network:激活已配置网络接口的脚本程序。

nfs:打开NFS服务。

nscdnscd(Name Switch Cache daemon)服务器,用于NIS一个支持服务,它高速缓存用户口令和组成成员关系。

portmapRPC portmap管理器,与inetd类似,它管理基于RPC服务的连接。

postgresql:一种SQL数据库服务器。

routed:路由守候进程,使用动态RIP路由选择协议。

rstatd:一个为LAN上的其它机器收集和提供系统信息的守候程序。

ruserd:远程用户定位服务,这是一个基于RPC的服务,它提供关于当前记录到LAN上一个机器日志中的用户信息。

rwalld:激活rpc.rwall服务进程,这是一项基于RPC的服务,允许用户给每个注册到LAN机器的其他终端写消息。

rwhod:激活rwhod服务进程,它支持LANrwhoruptime服务。

sendmail:邮件服务器sendmail

smbSamba文件共享/打印服务。

snmpd:本地简单网络管理候进程。

squid:激活代理服务器squid

syslog:一个让系统引导时起动syslogklogd系统日志守候进程的脚本。

xfsX Window字型服务器,为本地和远程X服务器提供字型集。

xntpd:网络时间服务器。

ypbind:为NIS(网络信息系统)客户机激活ypbind服务进程。

yppasswddNIS口令服务器。

ypservNIS主服务器。

gpm:管鼠标的。

identdAUTH服务,在提供用户信息方面与finger类似。

 

     Red Hat Enterprise Linux ES release 4 (Nahant Update 3) chkconfig 命令参考

 

NAME

       chkconfig - updates and queries runlevel information for system services

 

SYNOPSIS

       chkconfig --list [name]

       chkconfig --add name

       chkconfig --del name

       chkconfig [--level levels] name

       chkconfig [--level levels] name

 

DESCRIPTION

       chkconfig provides a simple command-line tool for maintaining the /etc/rc[0-6].d directory hierarchy by relieving system administrators of the task

       of directly manipulating the numerous symbolic links in those directories.

 

       This implementation of chkconfig was inspired by the chkconfig command present in the IRIX operating system. Rather than maintaining  configuration

       information  outside of the /etc/rc[0-6].d hierarchy, however, this version directly manages the symlinks in /etc/rc[0-6].d. This leaves all of the

       configuration information regarding what services init starts in a single location.

 

       chkconfig has five distinct functions: adding new services for management, removing services from management, listing the current startup  informa-

       tion for services, changing the startup information for services, and checking the startup state of a particular service.

 

       When chkconfig is run without any options, it displays usage information.  If only a service name is given, it checks to see if the service is con-

       figured to be started in the current runlevel. If it is, chkconfig returns true; otherwise it returns false. The --level option may be used to have

       chkconfig query an alternative runlevel rather than the current one.

 

       If  one  of on, off, or reset is specified after the service name, chkconfig changes the startup information for the specified service.  The on and

       off flags cause the service to be started or stopped, respectively, in the runlevels being changed.  The reset flag resets the startup  information

       for the service to whatever is specified in the init script in question.

 

       By  default, the on and off options affect only runlevels 2, 3, 4, and 5, while reset affects all of the runlevels.  The --level option may be used

       to specify which runlevels are affected.

 

       Note that for every service, each runlevel has either a start script or a stop script.   When  switching  runlevels,  init  will  not  re-start  an

       already-started service, and will not re-stop a service that is not running.

 

OPTIONS

       --level levels

              Specifies  the  run levels an operation should pertain to. It is given as a string of numbers from 0 to 7. For example, --level 35 specifies

              runlevels 3 and 5.

 

       --add name

 

              This option adds a new service for management by chkconfig.  When a new service is added, chkconfig ensures that the service  has  either  a

              start  or  a kill entry in every runlevel. If any runlevel is missing such an entry, chkconfig creates the appropriate entry as specified by

              the default values in the init script. Note that default entries in LSB-delimited \u2019INIT INFO\u2019 sections take precedence over the default run-

              levels in the initscript.

:       to specify which runlevels are affected.

 

       Note that for every service, each runlevel has either a start script or a stop script.   When  switching  runlevels,  init  will  not  re-start  an

       already-started service, and will not re-stop a service that is not running.

 

OPTIONS

       --level levels

              Specifies  the  run levels an operation should pertain to. It is given as a string of numbers from 0 to 7. For example, --level 35 specifies

              runlevels 3 and 5.

 

       --add name

 

              This option adds a new service for management by chkconfig.  When a new service is added, chkconfig ensures that the service  has  either  a

              start  or  a kill entry in every runlevel. If any runlevel is missing such an entry, chkconfig creates the appropriate entry as specified by

              the default values in the init script. Note that default entries in LSB-delimited \u2019INIT INFO\u2019 sections take precedence over the default run-

              levels in the initscript.

 

       --del name

              The service is removed from chkconfig management, and any symbolic links in /etc/rc[0-6].d which pertain to it are removed.

 

              Note  that future package installs for this service may run chkconfig --add, which will re-add such links. To disable a service, run chkcon-

              fig name off.

 

       --list name

              This option lists all of the services which chkconfig knows about, and whether they are stopped or started in  each  runlevel.  If  name  is

              specified, information in only display about service name.

 

RUNLEVEL FILES

       Each  service  which should be manageable by chkconfig needs two or more commented lines added to its init.d script. The first line tells chkconfig

       what runlevels the service should be started in by default, as well as the start and stop priority levels. If the service should not,  by  default,

       be started in any runlevels, a - should be used in place of the runlevels list.  The second line contains a description for the service, and may be

       extended across multiple lines with backslash continuation.

 

       For example, random.init has these three lines:

       # chkconfig: 2345 20 80

       # description: Saves and restores system entropy pool for \

       #              higher quality random number generation.

       This says that the random script should be started in levels 2, 3, 4, and 5, that its start priority should be  20,  and  that  its  stop  priority

       should  be 80.  You should be able to figure out what the description says; the \ causes the line to be continued.  The extra space in front of the

       line is ignored.

 

SEE ALSO

       init(8) ntsysv(8) system-config-services(8)

 

AUTHOR

       Erik Troan

 

4th Berkeley Distribution                                             Wed Oct 8 1997                                                          CHKCONFIG(8)

 

 

阅读(2878) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~