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!
thx
--
View this message in context:
http://www.nabble.com/runlevel-script-for-debian-ubuntu-tp18237480p18237480.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.