- 论坛徽章:
- 0
|
原帖由 网中人 于 2006-11-3 02:43 发表
这是个好问题!
据我所知 service 只有在 RH/FC 系列才有,说穿了也没啥,就是将 /etc/init.d 底下的 script 跑一下而已。
如果你要 service xxx start,但在别的系统找不到,那就 /etc/init.d/xxx start ,效 ...
我补充一下,其实 chkconfig 目前读取的 /etc/init.d/ 内的文档写法已经有详细规定的....
以前写法一般是:
- # chkconfig: 2345 90 60
- # description: cron is a standard UNIX program that runs user-specified \
- # programs at periodic scheduled times. vixie cron adds a \
- # number of features to the basic UNIX cron, including better \
- # security and more powerful configuration options.
复制代码
但是新式的 chkconfig 不看这些栏位了,而是看:
- ### BEGIN INIT INFO
- # Provides: crond
- # Required-Start: $syslog
- # Required-Stop: $syslog
- # Default-Start: 2 3 4 5
- # Short-Description: The cron clock daemon
- # Description: cron is a standard UNIX program that runs user-specified
- # programs at periodic scheduled times. vixie cron adds a
- # number of features to the basic UNIX cron, including better
- # security and more powerful configuration options.
- ### END INIT INFO
复制代码
其中最少得有 Default-Start 与 Description 这两个项目。
后者会有这些调整,都是因为 LSB 的标准所制定。详细部份请阅读:
http://refspecs.freestandards.org/LSB_2.0.1/LSB-Core/LSB-Core/initscrcomconv.html
所以一般 linux distro 有机会会看到各自这两种写法,或者是两种写法都会同时使用。
suse linux 是比较早就先纳入这些标准使用,而 rh/fedora 等其实目前的版本也已经纳入这些标准。
-- |
|