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/
# vi jirad
-------------------------------------------------------------------------------------
#!/bin/bash
### BEGIN INIT INFO
# chkconfig: 2345 85 15
# Provides: atlassian
# Short-Description: Start and stop the Jira&Confluence server
# Description: Start and stop the Jira&Confluence server.
### END INIT INFO
#
. /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
export JAVA_HOME=/usr/local/java/jdk1.6.0_22
rm -rf /www/atlassian/jira/jira_home/.jira-home.lock
start(){
echo -n $"Starting Jira"
#daemon -c
$startup
RETVAL=$?
echo
}
stop(){
echo $"Stopping Jira"
$shutdown
RETVAL=$?
echo
}
restart(){
stop
sleep 10
start
}
status(){
numproc=`ps -ef | grep jira | grep -v "grep jira" | wc -l`
if [ $numproc -gt 0 ]; then
echo "Jira is running..."
else
echo "Jira 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 jirad
# chkconfig jirad on
# service jirad start
没有报错即成功
转载于:https://blog.51cto.com/tonyty163/465698