我看了又看,发现没有任何线索有帮助。我们有一个 tomcat 启动脚本,我们根据需要稍作修改。它在 Centos/redhat 6 机器上运行良好,但在 centos/redhat 5 机器上不起作用。
这是输出chkconfig --add tomcat
:
$ chkconfig --add tomcat
service tomcat does not support chkconfig
这是 tomcat 脚本的顶部部分
#!/bin/bash
#
# Tomcat 8 start/stop/status init.d script
# Initially forked from: https://gist.github.com/valotas/1000094
# @author: Miglen Evlogiev <[email protected]>
#
# Release updates:
# Updated method for gathering pid of the current proccess
# Added usage of CATALINA_BASE
# Added coloring and additional status
# Added check for existence of the tomcat user
# Added termination proccess
#chkconfig: 2345 20 80
#discription Tomcat Starup Script
#Location of JAVA_HOME (bin files)
答案1
将“描述”替换为“描述:”(拼写错误且缺少冒号)。
RHEL 5 需要“chkconfig:”和“description:”,RHEL6 只需要“chkconfig:”。