東北證券網金部jira項目管理系統,常常莫名掛掉,因而乎將jira服務加入開機自啓動。spa
jira.sh腳本代碼以下:rest
#!/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
步驟:code
# 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