JBoss Community

Re: Init script of jboss 4.2.3 GA - jdk6 for Debian 7

created by Mikel Vadillo in Beginner's Corner - View the full discussion

Hi everyone....

 

At the end i found the problem in the man pages of start-stop-daemon:

 

−S,−−start [−−]arguments

 

Check for the existence of a specified process. If such a process exists,start−stop−daemon does nothing, and exits with error status 1 (0 if −−oknodo is specified). If such a process does not exist, it starts an instance, using either the executable specified by−−exec or, if specified, by−−startas. Any arguments given after−− on the command line are passed unmodified to the program being started.



 

so .......

 

...
PARAMS="-b 192.168.1.205"
DAEMON=${JBOSS_HOME}/bin/run.sh
...
do_start(){   
        start-stop-daemon --start --chuid jboss --user jboss --name jboss  --exec ${DAEMON} -- ${PARAMS}
    }
....

 

I was missing the -- before the parametres.

 

Thanks all anyway......

 

P.D.: the complete final script with a sleep modification too:

 

#!/bin/sh
### BEGIN INIT INFO
# Provides: jboss
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start/Stop JBoss AS v7.0.0
### END INIT INFO


JBOSS_HOME=/opt/jboss

JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk-i386

 

export JAVA_HOME
export JBOSS_HOME

 

PARAMS="-b 192.168.1.205"
DAEMON=${JBOSS_HOME}/bin/run.sh

 

do_start(){
  start-stop-daemon --start --chuid jboss --user jboss --name jboss -b --exec ${DAEMON} -- ${PARAMS}
}

 

do_stop(){
  start-stop-daemon --stop -u jboss
  rm -f ${PIDFILE}
}

 

case "$1" in
    start)
        echo "Starting JBoss 4.2.3"
do_start
    ;;
    stop)
        echo "Stopping JBoss 4.2.3"
do_stop
    ;;
    restart)
echo "Restarting JBoss 4.2.3"
do_stop
sleep 30
do_start
    ;;
    *)
        echo "Usage: /etc/init.d/jboss4.2.3 {start|stop|restart}"
        exit 1
    ;;
esac

Reply to this message by going to Community

Start a new discussion in Beginner's Corner at Community