0
votes

I am currently evaluating some of the WSO2 servers, one of them is the BAM 2.0 (on the carbon 4.0.1).
So far, in the packages was always a daemon.sh file included, which could be installed with chkconfig as a Linux daemon.

Sadly in the latest version of carbon, the daemon.sh is missing.
The startup script wso2server.sh can be used for starting the service, but it can not be installed as a linux daemon.

chkconfig returns:

[xxx@Server ~]$ sudo chkconfig --add wso2
service wso2 does not support chkconfig

I am trying this on a CentOS release 6.2 - 64 Bit.

Tried to find a description of how to install carbon as a linux daemon in the docs and in the forums - without success.

Thanks.

1

1 Answers

1
votes

I rolled my own basic init script for BAM 2.0.0. (The following are parts from a file named 'bam'.)

#!/bin/sh
#
# chkconfig: 2345 80 80
#
BAM_HOME=/home/bam/current_bam
BAM_DAEMON=bin/wso2server.sh
START_OPTIONS=start
STOP_OPTIONS=stop

start() {
    echo "Starting BAM... (it will take approx 2 mins.)"
    su bam -c "cd $BAM_HOME && $BAM_DAEMON $START_OPTIONS > /dev/null 2>&1"
    return 0
}

stop() {
    echo "Stopping BAM... (it will take approx 10 secs.)"
    su bam -c "cd $BAM_HOME && $BAM_DAEMON $STOP_OPTIONS > /dev/null 2>&1"
    return 0
}

case "$1" in
  start)
    start
    ;;
  stop)
    stop
    ;;
  restart)
    stop
    start
    ;;
  *)
    echo $"Usage: $0 {start|stop|restart}"
    exit 1
esac

exit $?

Then I copied it to /etc/init.d/ and made it executable. Lastly, I chkconfig'd it.

Now I can start the service with:

sudo service bam start