将jira添加至开机自启动

东北证券网金部jira项目管理系统,经常莫名挂掉,于是乎将jira服务加入开机自启动。

jira.sh脚本代码如下:

#!/bin/sh     
# chkconfig: 2345 10 90 
# description:jira server

jira_home=/opt/atlassian/jira
server_name=jira

case "$1" in  
start)  
    echo "Starting $server_name "  
    $jira_home/bin/start-jira.sh  
    ;;  
stop)  
    echo "Stoping $server_name "  
    $jira_home/bin/stop-jira.sh   
    ;;  
restart)  
    stop  
    start  
    ;;  
status)  
    ps aux|grep $jira_home  
    ;;  
*)  
    echo 'Usage: %s {start|stop|restart|status}\n' "$prog"  
    exit 1  
    ;;  
esac 

 

步骤:

# 0.将jira.sh复制至/etc/init.d/目录下
[root@localhost ~]# cp -a jira.sh /etc/init.d/jira

# 1.给jira脚本给与执行权限
[root@localhost ~]# chmod +x /etc/init.d/jira

# 2.设置开机启动项
[root@localhost ~]# chkconfig --add jira
[root@localhost ~]# chkconfig --level 345 jira on

 

posted @ 2018-12-04 10:51  何瑞  阅读(1952)  评论(0编辑  收藏  举报