activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lkwg82 <lkw...@gmx.de>
Subject Re: runlevel script for debian/ubuntu
Date Tue, 08 Jul 2008 07:50:14 GMT



bsnyder wrote:
> 
> On Wed, Jul 2, 2008 at 7:28 AM, lkwg82 <lkwg82@gmx.de> wrote:
>>
>> first repair the start-script, go to the bin directory of activemq
>> do
>> # sed -e 's#\r$##g' activemq-admin > activemq-admin.sh && chmod +x
>> activemq-admin.sh
>>
>> this is converting from win32 to linux end of lines and make it
>> executable
>> as new file
>>
>> second, change to root
>> # su
>> # cd /etc/init.d/
>> # vi activemq
>>
>> insert the following code
>>
>>
>> #! /bin/sh
>>
>> # the base directory
>> AMQ_DIR="/home/skype/activemq/apache-activemq-5.1.0/"
>>
>> # run the instance as user
>> AMQ_USER=am
>>
>> CMD="nohup $AMQ_DIR/bin/activemq-admin.sh"
>>
>> case "$1" in
>>    start)
>>        echo "Starting ActiveMQ "
>>        /bin/su - $AMQ_USER -c "$CMD $1 >/dev/null 2>&1 &"
>>        ;;
>>    stop)
>>        echo "Shutting down ActiveMQ"
>>        /bin/su - $AMQ_USER -c "$CMD $1 >/dev/null 2>&1 &"
>>        ;;
>>    restart)
>>        $0 stop
>>        $0 start
>>        ;;
>>    status)
>>        echo not yet implemented
>>        ;;
>>    *)
>>        echo "Usage: $0 {start|stop|restart|status}"
>>        exit 1
>>        ;;
>> esac
>>
>>
>> quit and save
>>
>> # chmod +x activemq
>>
>> make it executable
>>
>> # ln -s /etc/init.d/activemq /etc/rc2.d/S50activemq
>>
>> automatic start
>>
>>
>> now, every reboot ur activemq is running
>>
>>
>> Would be nice, if the developer would add this to the documentation!
> 
> Is there any reason why you can't use the wrapper scripts that ship as
> part of ActiveMQ?:
> 
> http://activemq.apache.org/java-service-wrapper.html
> 
> Bruce
> -- 
> perl -e 'print
> unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
> );'
> 
> Apache ActiveMQ - http://activemq.org/
> Apache Camel - http://activemq.org/camel/
> Apache ServiceMix - http://servicemix.org/
> 
> Blog: http://bruceblog.org/
> 
> 

why I did:

 where can I specify the user run the queue?

 this is missing and the linux EOL is to be fixed

 mostly of security I wrapped the wrapper  ;) 
-- 
View this message in context: http://www.nabble.com/runlevel-script-for-debian-ubuntu-tp18237480p18333798.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message