1. put the file autoxms into the DIR: /etc/init.d/
2. excute the CMD as the user root: chmod 755 autoxms
3.create the following soft links. You will need to be logged in as
superuser to do this:
ln -s /etc/init.d/autoxms /etc/rc3.d/S99autoxms
ln -s /etc/init.d/autoxms /etc/rc2.d/K10autoxms
ln -s /etc/init.d/autoxms /etc/rc0.d/K10autoxms
ln -s /etc/init.d/autoxms /etc/rc2.d/K10autoxms
ln -s /etc/init.d/autoxms /etc/rc0.d/K10autoxms
Once this is done, autoxms will start automatically at boot time.
Also, the /etc/init.d/autoxms command can be used to start or stop
Also, the /etc/init.d/autoxms command can be used to start or stop
> /etc/init.d/autoxms start
> /etc/init.d/autoxms stop
> /etc/init.d/autoxms stop
下面是autoxms的脚本在ksh和bash下通过
USER=root
JBOSS_DIR=/java/jboss/bin/
TOMCAT_ECS_DIR=/java/tomcat2/bin/
TOMCAT_EWPS_DIR=/java/tomcat/bin/
ENV_FILE=run.sh
JBOSS_DIR=/java/jboss/bin/
TOMCAT_ECS_DIR=/java/tomcat2/bin/
TOMCAT_EWPS_DIR=/java/tomcat/bin/
ENV_FILE=run.sh
case "$1" in
'start')
'start')
# Start up from a known location
cd /tmp
echo "starting autoxms as $USER"
# Source the CTS configuration
if [ -f $JBOSS_DIR/run.sh ] ; then
if [ -f $JBOSS_DIR/run.sh ] ; then
su - $USER -c "$JBOSS_DIR/run.sh" &
su - $USER -c "$TOMCAT_EWPS_DIR/startup.sh" &
su - $USER -c "$TOMCAT_ECS_DIR/startup.sh" &
su - $USER -c "$TOMCAT_EWPS_DIR/startup.sh" &
su - $USER -c "$TOMCAT_ECS_DIR/startup.sh" &
else
echo "$PARAM_DIR/$ENV_FILE file not found. Exiting."
fi
# Start the processes
;;
'stop')
# Stop from a known location
cd /tmp
echo "Stopping earthworm as $USER"
cd /tmp
echo "Stopping earthworm as $USER"
# Source the CTS configuration
if [ -f $JBOSS_DIR/run.sh ] ; then
su - $USER -c "$JBOSS_DIR/shutdown.sh -S" &
su - $USER -c "$TOMCAT_EWPS_DIR/shutdown.sh" &
su - $USER -c "$TOMCAT_ECS_DIR/shutdown.sh" &
else
echo "$PARAM_DIR/$ENV_FILE file not found. Exiting."
fi
su - $USER -c "$JBOSS_DIR/shutdown.sh -S" &
su - $USER -c "$TOMCAT_EWPS_DIR/shutdown.sh" &
su - $USER -c "$TOMCAT_ECS_DIR/shutdown.sh" &
else
echo "$PARAM_DIR/$ENV_FILE file not found. Exiting."
fi
;;
esac