You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by amerigo5 <am...@hotmail.com> on 2006/05/12 18:14:16 UTC

ActiveMQ as Service in Linux

Can anyone share a documentation on how to make ActiveMQ run as a service in
Linux without using the Tanuki Software (wrapper)?

Thanks.
--
View this message in context: http://www.nabble.com/ActiveMQ-as-Service-in-Linux-t1608673.html#a4361066
Sent from the ActiveMQ - User forum at Nabble.com.


Re: ActiveMQ as Service in Linux: Windows too?

Posted by superuser <pe...@automotive.com>.
In a similar vein, does anyone have instructions on how to run activemq on
windows via the tankisoft wrapper (wrapper.tanukisoftware.org)?
-- 
View this message in context: http://www.nabble.com/ActiveMQ-as-Service-in-Linux-tf1608673.html#a5443588
Sent from the ActiveMQ - User forum at Nabble.com.


Re: ActiveMQ as Service in Linux

Posted by James Strachan <ja...@gmail.com>.
Many thanks for these great instructions. I've added them to the wiki...

http://goopen.org/confluence/display/ACTIVEMQ/Unix+Service


On 5/26/06, amerigo5 <am...@hotmail.com> wrote:
>
> Below are steps to make ActiveMQ a Linux Daemon on Red Hat 4 ES.
>
> It's based on
> http://www-128.ibm.com/developerworks/java/library/l-secjav.html
>
> ------------------------------------------------------------------------------------------------
> Settings:
>
>  - JAVA_HOME=/opt/java/jdk1.5.0_06
>
>  - ActiveMQ?=/opt/activemq/incubator-activemq-4.0
> ------------------------------------------------------------------------------------------------
> ------------------------------------------------------------------------------------------------
> Installation
> ------------------------------------------------------------------------------------------------
> Sun Java JDK
>
> 1. Install Sun Java JDK on /opt/java/ directory.
>
> 2. Create a shortcut to JDK directory:
>
> # sudo ln -s /opt/java/jdk1.5.0_06 /opt/java/java
> ------------------------------------------------------------------------------------------------
> ActiveMQ
>
> 1. Install ActiveMQ on /opt/activemq/ directory.
>
> 2. Make ActiveMQ startup and shutdown scripts executable:
>
> # sudo chmod +x /opt/activemq/incubator-activemq-4.0/bin/activemq
> # sudo chmod +x /opt/activemq/incubator-activemq-4.0/bin/shutdown
> ------------------------------------------------------------------------------------------------
> ------------------------------------------------------------------------------------------------
> ActiveMQ as Linux Daemon
>
> 1. Create activemq user:
>
> # sudo /usr/sbin/useradd activemq
>
> 2. Create ActiveMQ startup script /home/activemq/activemqstart.sh with the
> following content:
>
> #!/bin/bash
> export JDK_HOME=/opt/java/java
> export JAVA_HOME=/opt/java/java
> /opt/activemq/incubator-activemq-4.0/bin/activemq &
>
> 3. Make /home/activemq/activemqstart.sh executable:
>
> # sudo chmod +x /home/activemq/activemqstart.sh
>
> 4. Create ActiveMQ shutdown script /home/activemq/activemqstop.sh with the
> following content:
>
> #!/bin/bash
> export JDK_HOME=/opt/java/java
> export JAVA_HOME=/opt/java/java
> /opt/activemq/incubator-activemq-4.0/bin/shutdown
>
> 5. Make /home/activemq/activemqstop.sh executable:
>
> # sudo chmod +x /home/activemq/activemqstop.sh
>
> 6. Create ActiveMQ Linux service configuration script /etc/init.d/activemq
> with the following content:
>
> #!/bin/bash
> #
> # activemq       Starts ActiveMQ.
> #
> #
> # chkconfig: 345 88 12
> # description: ActiveMQ is a JMS Messaging Queue Server.
> ### BEGIN INIT INFO
> # Provides: $activemq
> ### END INIT INFO
>
> # Source function library.
> . /etc/init.d/functions
>
> [ -f /home/activemq/activemqstart.sh ] || exit 0
> [ -f /home/activemq/activemqstop.sh ] || exit 0
>
> RETVAL=0
>
> umask 077
>
> start() {
>         echo -n $"Starting ActiveMQ: "
>         daemon /home/activemq/activemqstart.sh
>         echo
>         return $RETVAL
> }
> stop() {
>         echo -n $"Shutting down ActiveMQ: "
>         daemon su -c /home/activemq/activemqstop.sh activemq
>         echo
>         return $RETVAL
> }
> restart() {
>         stop
>         start
> }
> case "$1" in
>   start)
>         start
>         ;;
>   stop)
>         stop
>         ;;
>   restart|reload)
>         restart
>         ;;
>   *)
>         echo $"Usage: $0 {start|stop|restart}"
>         exit 1
> esac
>
> exit $?
>
> 7. Enable ActiveMQ service configuration as Linux Daemon:
>
> # sudo chmod +x /etc/init.d/activemq
> # sudo /sbin/chkconfig --add activemq
> # sudo /sbin/chkconfig activemq on
>
> 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
> ------------------------------------------------------------------------------------------------
> --
> View this message in context: http://www.nabble.com/ActiveMQ+as+Service+in+Linux-t1608673.html#a4581699
> Sent from the ActiveMQ - User forum at Nabble.com.
>
>


-- 

James
-------
http://radio.weblogs.com/0112098/

Re: ActiveMQ as Service in Linux

Posted by amerigo5 <am...@hotmail.com>.
Below are steps to make ActiveMQ a Linux Daemon on Red Hat 4 ES.

It's based on
http://www-128.ibm.com/developerworks/java/library/l-secjav.html

------------------------------------------------------------------------------------------------
Settings:

 - JAVA_HOME=/opt/java/jdk1.5.0_06 

 - ActiveMQ?=/opt/activemq/incubator-activemq-4.0
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Installation
------------------------------------------------------------------------------------------------
Sun Java JDK

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

2. Create a shortcut to JDK directory:

# sudo ln -s /opt/java/jdk1.5.0_06 /opt/java/java
------------------------------------------------------------------------------------------------
ActiveMQ

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

2. Make ActiveMQ startup and shutdown scripts executable:

# sudo chmod +x /opt/activemq/incubator-activemq-4.0/bin/activemq
# sudo chmod +x /opt/activemq/incubator-activemq-4.0/bin/shutdown
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
ActiveMQ as Linux Daemon

1. Create activemq user:

# sudo /usr/sbin/useradd activemq

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

#!/bin/bash
export JDK_HOME=/opt/java/java
export JAVA_HOME=/opt/java/java
/opt/activemq/incubator-activemq-4.0/bin/activemq &

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

# sudo chmod +x /home/activemq/activemqstart.sh

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

#!/bin/bash
export JDK_HOME=/opt/java/java
export JAVA_HOME=/opt/java/java
/opt/activemq/incubator-activemq-4.0/bin/shutdown

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

# sudo chmod +x /home/activemq/activemqstop.sh

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

#!/bin/bash
#
# activemq       Starts ActiveMQ.
#
#
# chkconfig: 345 88 12
# description: ActiveMQ is a JMS Messaging Queue Server.
### BEGIN INIT INFO
# Provides: $activemq
### END INIT INFO

# Source function library.
. /etc/init.d/functions

[ -f /home/activemq/activemqstart.sh ] || exit 0
[ -f /home/activemq/activemqstop.sh ] || exit 0

RETVAL=0

umask 077

start() {
        echo -n $"Starting ActiveMQ: "
        daemon /home/activemq/activemqstart.sh
        echo
        return $RETVAL
}
stop() {
        echo -n $"Shutting down ActiveMQ: "
        daemon su -c /home/activemq/activemqstop.sh activemq
        echo
        return $RETVAL
}
restart() {
        stop
        start
}
case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart|reload)
        restart
        ;;
  *)
        echo $"Usage: $0 {start|stop|restart}"
        exit 1
esac

exit $?

7. Enable ActiveMQ service configuration as Linux Daemon:

# sudo chmod +x /etc/init.d/activemq
# sudo /sbin/chkconfig --add activemq
# sudo /sbin/chkconfig activemq on

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
------------------------------------------------------------------------------------------------
--
View this message in context: http://www.nabble.com/ActiveMQ+as+Service+in+Linux-t1608673.html#a4581699
Sent from the ActiveMQ - User forum at Nabble.com.