Creating a Unix Service for ActiveMQ

Below are steps to make ActiveMQ a Linux Daemon on Red Hat 4 ES.

It's based on this article.

Alternatively, you could also use the Java Service Wrapper implementation, refer to the Java Service Wrapper Page for more details.

Settings

Installation

Sun Java JDK

1. Install Sun Java JDK on /opt/java/ directory.

2. Create a shortcut to JDK directory:

ActiveMQ

1. Install ActiveMQ on /opt/activemq/ directory.

2. Make ActiveMQ startup and shutdown scripts executable:

ActiveMQ as Linux Daemon

1. Create activemq user:

2. Create ActiveMQ startup script /home/activemq/activemqstart.sh with the
following content:

3. Make /home/activemq/activemqstart.sh executable:

4. Create ActiveMQ shutdown script /home/activemq/activemqstop.sh with the
following content:

5. Make /home/activemq/activemqstop.sh executable:

6. Create ActiveMQ Linux service configuration script /etc/init.d/activemq
with the following content:

7. Enable ActiveMQ service configuration as Linux Daemon:

8. Restart the server.

Note: activemq-data is being created in "/" root directory. I have to
explicitly set the activemq-data location in activemq.conf

© 2004-2011 The Apache Software Foundation.
Apache ActiveMQ, ActiveMQ, Apache, the Apache feather logo, and the Apache ActiveMQ project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.
Graphic Design By Hiram