Apache Ace as a Service

226 Views Asked by At

I am trying to setup/configure Apache ACE for the first time. It seems like I got everything running correctly but I would like to have ACE startup automatically when the Linux box starts. I created the init.d script below which does starts up ACE however it drops me in an OSGI console and when I leave the console ACE shuts down. Is there a way to start ACE without having the OSGI console so I do not have to keep my session open to keep ACE running?

#! /bin/bash

BIN_DIR=/opt/ace-current/server-allinone
PATH=/bin:/usr/bin:/sbin:/usr/sbin
JAVA_HOME=/usr/lib/jvm/default-java

if [ `id -u` -ne 0 ]; then
        echo "You need root privileges to run this script"
        exit 1
fi

. /lib/lsb/init-functions

if [ -r /etc/default/rcS ]; then
        . /etc/default/rcS
fi

case $1 in
        start)
                cd $BIN_DIR
                java -Dorg.apache.ace.server=localhost:11868 -Dorg.osgi.service.http.port=11868 -Dorg.apache.ace.obr=localhost:11868 -jar server-allinone.jar 
        ;;

        stop)
                pid=`ps aux | grep server-allinone | awk '{print $2}'`
                kill -9 $pid
        ;;

        restart)
                $0 stop
                $0 start
        ;;
esac
exit 0  
1

There are 1 best solutions below

0
On
java -Dgosh.args=--nointeractive -jar server-allinone.jar

Will disable the local shell.