Fecru自啓動腳本

腳本下載地址:

http://down.51cto.com/data/156516

由於fecrurc.local是無法自啓動的,所以這裏附上fecru的啓動腳本

將以下腳本拷貝到/etc/init.d/fecrud

# cd /etc/init.d/

# vi fecrud

注意:以下幾個變量要根據自己的位置來調整FecruJAVA_HOME

-------------------------------------------------------------------------------------#!/bin/bash
### BEGIN INIT INFO
# chkconfig:    2345 85 15
# Provides:          atlassian
# Short-Description: Start and stop the Fecru server
# Description:       Start and stop the Fecru server.
### END INIT INFO
#
. /etc/init.d/functions

Fecru=/www/atlassian/fecru/2.4.3
startup=$Fecru/bin/start.sh
shutdown=$Fecru/bin/stop.sh
export JAVA_HOME=/usr/local/java/jdk1.6.0_22

start(){
 echo -n $"Starting Fecru"
 #daemon -c
 $startup
 RETVAL=$?
 echo
}

stop(){
 echo $"Stopping Fecru"
 $shutdown
 RETVAL=$?
 echo
}

restart(){
  stop
  sleep 10
  start
}

 

status(){
        numproc=`ps -ef | grep fecru | grep -v "grep fecru" | wc -l`
        if [ $numproc -gt 0 ]; then
                echo "Fecru is running..."
        else
                echo "Fecru is stopped..."
        fi
}


# See how we were called.
case "$1" in
start)
 start
 ;;
stop)
 stop
 ;;
status)
        numproc=`ps -ef | grep fecru | grep -v "grep fecru" | wc -l`
        if [ $numproc -gt 0 ]; then
                echo "Fecru is running..."
        else
                echo "Fecru is stopped..."
        fi
}


# See how we were called.
case "$1" in
start)
 start
 ;;
stop)
 stop
 ;;
status)
 status
 ;;
restart)
 restart
 ;;
*)
 echo $"Usage: $0 {start|stop|status|restart}"
 exit 1
esac

 

exit 0

-------------------------------------------------------------------------------------

 

# chkconfig --add fecrud

 

# chkconfig fecrud on

# service fecrud start

沒有報錯即成功

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章