1,编辑启动文件
vim /etc/init.d/activemq

#!/bin/sh # # /etc/init.d/activemq # chkconfig: 345 63 37 # description: activemq servlet container. # processname: activemq 5.14.1 # Source function library. #. /etc/init.d/functions # source networking configuration. #. /etc/sysconfig/network export JAVA_HOME=/usr/java/jdk1.7.0_79 export CATALINA_HOME=/usr/home/local/services/activemq/activemq case $1 in start) sh $CATALINA_HOME/bin/activemq start ;; stop) sh $CATALINA_HOME/bin/activemq stop ;; status) sh $CATALINA_HOME/bin/activemq status
;; restart) sh $CATALINA_HOME/bin/activemq stop sleep 1 sh $CATALINA_HOME/bin/activemq start ;; esac exit 0
2,添加执行权限
chmod +x /etc/init.d/activemq

3,添加到开机启动
chkconfig --add activemq

浙公网安备 33010602011771号