Linux将ActiveMQ修改为自启动

1、在root权限下操作

2、ln -s  /usr/local/activemq/bin/activemq /etc/init.d/activemq

3、vi /etc/init.d/activemq

4、在第二行添加

#### BEGIN INIT INFO  
# Provides:             activemq  
# Required-Start:       $remote_fs $syslog  
# Required-Stop:        $remote_fs $syslog  
# Default-Start:        2 3 4 5  
# Default-Stop:         0 6  
# chkconfig: 2345 64 36  
# Short-Description:    ActiveMQ server  
### END INIT INFO  

5、在最后一个#后添加

export JAVA_HOME=/usr/local/jdk
ACTIVEMQ_HOME=/usr/local/activemq  

6、chkconfig activemq on  设置成开机启动

7、chkconfig activemq off  设置成开机不启动

8、service activemq start /stop 启动/关闭

 

原文地址:https://www.cnblogs.com/xzlive/p/9083021.html