------------------------------------------------------------------------------------------------------------------------- #!/bin/bash #chkconfig: 2345 85 15 # description: jira # processname: jira # source function library . /etc/init.d/functions #把JAVA的环境变量配置也加进来 JAVA_HOME=/usr/lib/jvm/java-6-openjdk-amd64 CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/mysql-connector-java-5.1.29-bin.jar:$JAVA_HOME/lib/classes12.jar PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin export JAVA_HOME PATH CLASSPATH JIRA_HOME=/home/jira_workhome/work_home export JIRA_HOME #这一行为JIRA的安装路径(主目录),我的是直接 在/home/jira_workhome里面解压的。 Jira=/home/jira_workhome/atlassian-jira-6.1.5-standalone startup=$Jira/bin/startup.sh shutdown=$Jira/bin/shutdown.sh #export JAVA_HOME=/usr/lib/jvm/java-6-openjdk-amd64 #每次非正常关机后,启动的时候都需要将$Jira_Home中的.jira-home.lock文件删除,否则启动的时候会报错。 .jira-home.lock是一个锁文件,是为了保护jira安全的。 rm -rf /home/jira_workhome/work_home/.jira-home.lock start() { echo -n $"Starting jira services: " $startup RETVAL=$? echo } stop() { echo -n $"Shutting down jira services: " $shutdown RETVAL=$? echo } case "$1" in start) start ;; stop) stop ;; restart|reload) stop start ;; status) status jira RETVAL=$? ;; *) echo $"Usage: $0 {start|stop|restart|status}" exit 1 esac exit $RETVAL ------------------------------------------------------------------------------------------------------------------------------------------------- |