You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by dcausevic <dz...@bstelecom.ba> on 2010/06/29 14:55:37 UTC

Startup script for Axis2

I am running Ubuntu 9.04 (Jaunty Jackalope) in text mode and I wanted to add
Axis2 to my services that run on the system startup. Does anybody have a
custom startup script that I could put in my /etc/init.d/ directory, or can
I use $AXIS2_HOME/bin/axis2server.sh for this task? Has anyone tried this?

Thx, Dzenan
-- 
View this message in context: http://old.nabble.com/Startup-script-for-Axis2-tp29023324p29023324.html
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: Startup script for Axis2

Posted by dcausevic <dz...@bstelecom.ba>.
Here it is... I had to develep it myself. Anyway here it is if anyone else
might need it. It's for debian, but I am sure it would work with RedHat and
other distributions as well with minor changes in code.

#!/bin/sh

# Written by Dzenan Causevic <dz...@bstelecom.ba>

# JAVA_HOME and AXIS2_HOME must be defined prior to calling setenv.sh
export JAVA_HOME="/opt/tools/java/ejre1.6.0_10"
export AXIS2_HOME="/opt/tools/axis/axis2-1.5.1"

# Run setenv.sh to set environment variables $AXIS2_CLASSPATH
. $AXIS2_HOME/bin/setenv.sh || exit 0

# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=$JAVA_HOME/bin:/sbin:/usr/sbin:/bin:/usr/bin

DESC="Apache Axis2 web service engine"
NAME="axis2"
DAEMON="$JAVA_HOME/bin/java"
DAEMON_ARGS="-classpath $AXIS2_CLASSPATH
org.apache.axis2.transport.SimpleAxis2Server -repo $AXIS2_HOME/repository
-conf $AXIS2_HOME/conf/axis2.xm
l"
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/axis2
#the user that will run the script
USER=root

# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh

# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions

#
# Function that starts the daemon/service
#
do_start()
{
   start-stop-daemon -b --start --quiet --chuid $USER -m -p $PIDFILE --exec
$DAEMON -- $DAEMON_ARGS || return 2
}

#
# Function that stops the daemon/service
#
do_stop()
{
   start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE
   RETVAL="$?"
   rm -f $PIDFILE
   return "$RETVAL"
}

case "$1" in
  start)
    [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
    do_start
    case "$?" in
      0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
      2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
    esac
    ;;
  stop)
    [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
    do_stop
    case "$?" in
       0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
       2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
    esac
    ;;
  restart)
    #
    # If the "reload" option is implemented then remove the
    # 'force-reload' alias
    #
    log_daemon_msg "Restarting $DESC" "$NAME"
    do_stop
    case "$?" in
       0|1)
          do_start
          case "$?" in
             0) log_end_msg 0 ;;
             1) log_end_msg 1 ;; # Old process is still running
             *) log_end_msg 1 ;; # Failed to start
          esac
          ;;
       *)
          # Failed to stop
          log_end_msg 1
          ;;
    esac
    ;;
  *)
    echo "Usage: $SCRIPTNAME {start|stop|restart}" >&2
    exit 3
    ;;
esac

-- 
View this message in context: http://old.nabble.com/Startup-script-for-Axis2-tp29023324p29042409.html
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: Startup script for Axis2

Posted by Deepal Jayasinghe <de...@opensource.lk>.
I think $AXIS2_HOME/bin/axis2server.sh would do your job, try it and let's
know.

Deepal

On Tue, Jun 29, 2010 at 8:55 AM, dcausevic <dz...@bstelecom.ba>wrote:

>
> I am running Ubuntu 9.04 (Jaunty Jackalope) in text mode and I wanted to
> add
> Axis2 to my services that run on the system startup. Does anybody have a
> custom startup script that I could put in my /etc/init.d/ directory, or can
> I use $AXIS2_HOME/bin/axis2server.sh for this task? Has anyone tried this?
>
> Thx, Dzenan
> --
> View this message in context:
> http://old.nabble.com/Startup-script-for-Axis2-tp29023324p29023324.html
> Sent from the Axis - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>

Re: Startup script for Axis2

Posted by Afkham Azeez <af...@gmail.com>.
This may help.

http://wso2.org/library/2769

On Tue, Jun 29, 2010 at 6:25 PM, dcausevic <dz...@bstelecom.ba>wrote:

>
> I am running Ubuntu 9.04 (Jaunty Jackalope) in text mode and I wanted to
> add
> Axis2 to my services that run on the system startup. Does anybody have a
> custom startup script that I could put in my /etc/init.d/ directory, or can
> I use $AXIS2_HOME/bin/axis2server.sh for this task? Has anyone tried this?
>
> Thx, Dzenan
> --
> View this message in context:
> http://old.nabble.com/Startup-script-for-Axis2-tp29023324p29023324.html
> Sent from the Axis - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>


-- 
Afkham Azeez
Senior Software Architect & Product Manager, WSO2 WSAS; WSO2, Inc.;
http://wso2.com
Member; Apache Software Foundation; http://www.apache.org/
email: azeez@wso2.com cell: +94 77 3320919
blog: http://blog.afkham.org
twitter: http://twitter.com/afkham_azeez
linked-in: http://lk.linkedin.com/in/afkhamazeez

Lean . Enterprise . Middleware