apache这个问题其实很简单的(不知道的时候,好难),你只要把在安装路径下的bin目录下的apachectl文件复制到 /etc/rc.d/init.d/目录下,用文本编辑器打开他,在文件首部#!/bin/bash行下,加入以下几行
# chkconfig: 2345 50 40
# description This is Internet www Server
说明一下,description是描述这个服务用的,一定要写上对服务的描述,而且不可以是中文的,
chkconfig: 第一组数字是系统运行级2345表示的是将要设为启动的系统运行级别, 第二个数字是优先级,00优先级最高,当然考虑到依赖性,你的服务的优先级不宜过高,如果,比自己依赖的服务的优先级更高,那么您的服务将无法正常启动,第三组数字就是杀死服务的优先级
apache这个问题其实很简单的(不知道的时候,好难),你只要把在安装路径下的bin目录下的apachectl文件复制到 /etc/rc.d/init.d/目录下,用文本编辑器打开他,在文件首部#!/bin/bash行下,加入以下几行
# chkconfig: 2345 50 40
# description This is Internet www Server
说明一下,description是描述这个服务用的,一定要写上对服务的描述,而且不可以是中文的,
chkconfig: 第一组数字是系统运行级2345表示的是将要设为启动的系统运行级别, 第二个数字是优先级,00优先级最高,当然考虑到依赖性,你的服务的优先级不宜过高,如果,比自己依赖的服务的优先级更高,那么您的服务将无法正常启动,第三组数字就是杀死服务的优先级
您还可以用以下方法设置它将覆盖以上两句的设置
### BEGIN INIT INFO
# Provides: 服务名
# Required-Start: $local_fs $network (依赖的服务用空格隔开,$加上服务名,要求先启动的服务)
# Required-Stop: $local_fs $[/quote]
我想弄tomcat-5.5.9的自动启动,怎么不行呢??
我把 /usr/local/ jakarta-tomcat-5.5.9/bin/startup.sh 的文件拷贝到/etc/rc.d/init.d/底下
然后vi startup.sh
#!/bin/sh
#chkconfig:2345 50 40
#description This is Internet www Server
# -----------------------------------------------------------------------------
# Start Script for the CATALINA Server
#
# $Id: startup.sh,v 1.4 2004/11/17 20:17:46 yoavs Exp $
# -----------------------------------------------------------------------------
# Better OS/400 detection: see Bugzilla 31132
os400=false
case "`uname`" in
CYGWIN*) cygwin=true;;
OS400*) os400=true;;
esac
# resolve links - $0 may be a softlink
PRG="$0"
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '.*/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`/"$link"
fi
done
PRGDIR=`dirname "$PRG"`
EXECUTABLE=catalina.sh
# Check that target executable exists
if $os400; then
# -x will Only work on the os400 if the files are:
# 1. owned by the user
# 2. owned by the PRIMARY group of the user
# this will not work if the user belongs in secondary groups
eval
else
if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
echo "Cannot find $PRGDIR/$EXECUTABLE"
echo "This file is needed to run this program"
exit 1
fi
fi