Jira自啟動腳本下載地址:
http://down.51cto.com/data/156573
由於jira用rc.local是無法自啟動的,這裡附上jira的啟動腳本
這裡還有一點需要注意的,每次非正常關機后,啟動的時候都需要將$Jira_Home中的.jira-home.lock文件刪除,否則啟動的時候會報錯.
.jira-home.lock是一個鎖文件,是為了保護jira安全的.
將以下腳本拷貝到/etc/init.d/jirad
#cd/etc/init.d/
#vijirad
-------------------------------------------------------------------------------------
#!/bin/bash
###BEGININITINFO
#chkconfig:23458515
#Provides:atlassian
#Short-Description:StartandstoptheJira&Confluenceserver
#Description:StartandstoptheJira&Confluenceserver.
###ENDINITINFO
#
./etc/init.d/functions
Jira=/www/atlassian/crowd/4.2.1
startup=$Jira/apache-tomcat/bin/startup.sh
shutdown=$Jira/apache-tomcat/bin/shutdown.sh
exportJAVA_HOME=/usr/local/java/jdk1.6.0_22
rm -rf /www/atlassian/jira/jira_home/.jira-home.lock
start(){
echo-n$"StartingJira"
#daemon-c
$startup
RETVAL=$?
echo
}
stop(){
echo$"StoppingJira"
$shutdown
RETVAL=$?
echo
}
restart(){
stop
sleep 10
start
}
status(){
numproc=`ps-ef|grepjira|grep-v"grepjira"|wc-l`
if[$numproc-gt0];then
echo"Jiraisrunning..."
else
echo"Jiraisstopped..."
fi
}
#Seehowwewerecalled.
case"$1"in
start)
start
;;
stop)
stop
;;
status)
status
;;
restart)
restart
;;
*)
echo$"Usage:$0{start|stop|status|restart}"
exit1
esac
exit0
-------------------------------------------------------------------------------------
#chkconfig--addjirad
#chkconfigjiradon
#servicejiradstart
沒有報錯即成功
[火星人 ] Jira自啟動腳本已經有341次圍觀