jira 的启动主要依靠的是bin目录下的catalina.sh脚本,提供了如init脚本的start,stop等参数
----------------------------------------------------------------------------------------------------------------
#!/bin/bash
#
# chkconfig: 2345 85 15
# description: jira
# processname: jira
# source function library
. /etc/init.d/functions
#下面一行比较重要,为jira的安装路径,没有的话,将会提示找不到文件
CATALINA_HOME="/var/www/jira"
RETVAL=0
start() {
echo -n $"Starting jira services: "
. /var/www/jira/bin/catalina.sh start
RETVAL=$?
echo
}
stop() {
echo -n $"Shutting down jira services: "
. /var/www/jira/bin/catalina.sh stop
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
-------------------------------
保存为/etc/init.d/jira
需要对jira 文件赋可执行权限 chmod +x /etc/init.d/jira
然后利用chkconfig --add jira 添加自启动
chkconfig --list 查看
验证是否生效:
reboot之后,jira正常启动。