歡迎您光臨本站 註冊首頁

chkconfig---man (自己翻譯的,有錯誤大家指出)

←手機掃碼閱讀     火星人 @ 2014-03-23 , reply:0

CHKCONFIG(8) CHKCONFIG(8)

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.

chkconfig 提供了一個簡單的命令行工具用於維護/etc/rc[0-6].d的路徑層次,可以幫助系統管理員在這些路徑中直接操作符號行
PS:簡單的說就是用於維護/etc/rc[0.6].d的命令行,用不著這麼麻煩

This implementation of chkconfig was inspired by the chkconfig command
present in the IRIX operating system. Rather than maintaining configu-
ration 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 的執行是通過chkconfig命令激發的,此命令目前在irix操作系統中存在。甚至包括了維護/etc/rc[0-6].d層次之外的設置信息
但是本版本命令直接管理在/etc/rc[0-6].d中的符號行,這些設置信息主要是關於哪些服務在機器啟動的時候就已經運行
PS:簡單的說,就是chkconfig命令在irix操作系統中統統存在,甚至可以管理其他信息,但是我們這個說明,主要是關於那種服務在啟動的時候自動運行,至於irix是sgi公司基於unix的圖形工作站的應用軟體,不是操作系統

chkconfig has five distinct functions: adding new services for manage-
ment, removing services from management, listing the current startup
information for services, changing the startup information for ser-
vices, and checking the startup state of a particular service.

chkconfig有5個不同的函數:為管理器添加新服務,從管理器中移出服務,列出當前啟動的服務信息,改變服務啟動信息,檢查特殊服務的啟動狀態

When chkconfig is run without any options, it displays usage informa-
tion. If only a service name is given, it checks to see if the service
is configured to be started in the current runlevel. If it is, chkcon-
fig returns true; otherwise it returns false. The --level option may be
used to have chkconfig query an alternative runlevel rather than the
current one.

當chkconfig沒有任何參數運行的時候,它會顯示用法信息,如果僅僅給了一個服務名稱,他會去檢查服務在目前的運行級別上是否被設定是可以運行的,如果可以運行的話,chkconfig返回true;不然的話返回false.--level選項被用來詢問相對於目前運行等級,之外的一種運行登記
PS:返回true就是shell里什麼都沒有 ,--level是用來查詢服務在其他等級是否可以運行的

If one of on, off, or reset is specified after the service name, chk-
config changes the startup information for the specified service. The
init script in question.

如果on off reset 跟在服務明後面,那麼chkconfig會改變特定服務的啟動信息,但是啟動腳本還是被懷疑的
PS:介紹on off reset 而已

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.

默認的情況下,on和off選項只能在2.3.4,5級別下運行,而reset則在可以作用到所有的級別,--level選項可以確定那是一個級別能夠起作用

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.
注意對所有的服務,每一個級別要麼有一個啟動腳本,要麼有一個停止腳本,當改變運行級別時,啟動不會重新啟動一個已經運行的服務,也不會重新停止一個沒有運行的服務

chkconfig also can manage xinetd scripts via the means of xinetd.d con-
figuration files. Note that only the on, off, and --list commands are
supported for xinetd.d services.

chkconfig同樣可以管理超級守護進程經由xinetd.d的設置文件含義,注意這裡僅僅可以用on 和off,並且--list命令也是支持xinetd.d服務的

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.
確定相應的運行級別,這個可以用0到7,比如說 --level 35 指的是運行級別是3和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 appro-
priate entry as specified by the default values in the init
script. Note that default entries in LSB-delimited 』INIT INFO』
sections take precedence over the default runlevels in the
initscript.
這個選項通過chkconfig給管理器增加一個服務的名字,當一個服務被添加的時候,chkconfig需要確定這個服務有一個開始入口或者結束入口在每一種運行級別。如果任何的一個運行級別缺少這樣的入口,chkconfig會通過init腳本建立適合的入口,注意,在最低有效位界限「init info」模塊中的默認入口,優先於init腳本的默認啟動級別

--del name
The service is removed from chkconfig management, and any sym-
bolic links in /etc/rc[0-6].d which pertain to it are removed.
服務被從chkconfig管理中移出,並且在/etc/rc[0-6].d中相應的符號行也會被移出

Note that future package installs for this service may run chk-
config --add, which will re-add such links. To disable a ser-
vice, run chkconfig 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.
這個選項會把所有的chkconfig認識的服務統統列出來,不管他是否被停止或者開始在任何運行級別,如果服務名字給出了,那麼信息僅僅顯示特定服務

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 chk-
config 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 con-
tinuation.

每一個能夠被chkconfig管理的服務必須要有2行或者更多的註釋添加到他的init.d 腳本中,第一行告訴chkconfig服務的默認運行級別,還有運行級別的開始和結束的有限級,如果服務沒有註明這些的話,那麼可以在任意的級別運行,第 2行是包括對於服務的描述,並且能夠通過多重的反斜扛來擴充

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 <ewt@redhat.com>

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

[火星人 ] chkconfig---man (自己翻譯的,有錯誤大家指出)已經有568次圍觀

http://coctec.com/docs/linux/show-post-126257.html