ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 如何在linux添加服务

如何在linux添加服务

原创 Linux操作系统 作者:lfree 时间:2007-08-14 00:00:00 0 删除 编辑

最近要写一个oracle启动服务,遇到一个问题,特记录如下:编写好脚本后,测试可以正常启动与关闭,加入服务的时候出现如下提示:

chkconfig --add oracle
service oracle does not support chkconfig

google发现如下链接:
http://lists.suse.com/archives/suse-oracle/2001-Jun/0143.html
Make sure the rc script has a chkconfig-conforming header.
Citing the manual page:

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.


仔细检查我写的oracle脚本,发现description 我少写一个冒号,加入后,在执行
chkconfig --add oracle

一切正常。


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/267265/viewspace-83086/,如需转载,请注明出处,否则将追究法律责任。

上一篇: ORACLE的启动脚本
请登录后发表评论 登录
全部评论
熟悉oracle相关技术,擅长sql优化,rman备份与恢复,熟悉linux shell编程。

注册时间:2008-01-03

  • 博文量
    2485
  • 访问量
    6290623