dcm4chee won't start on boot

541 views
Skip to first unread message

ttkrpink

unread,
Oct 1, 2014, 1:30:23 AM10/1/14
to
Here is my code in /etc/init.d/. After reboot, you can start with "sudo service dcm.sh start", but it won't start on boot. I can't find any log info neither. 
I have another server that have the same setup just fine.

JBOSS_USER=${JBOSS_USER:-"RUNASIS"} was set right.

java version 1.7.0_68.

Thanks for any help

#define where jboss is - this is the directory containing directories log, bin, conf etc
JBOSS_HOME=${JBOSS_HOME:-"/usr/local/dcm4chee"}

#define the user under which jboss will run, or use 'RUNASIS' to run as the current user
#JBOSS_USER=${JBOSS_USER:-"pacs"}
JBOSS_USER=${JBOSS_USER:-"RUNASIS"}

#make sure java is in your path
JAVAPTH=${JAVAPTH:-"/usr/java/jdk/bin"}

#configuration to use, usually one of 'minimal', 'default', 'all'
JBOSS_CONF=${JBOSS_CONF:-"default"}

# JMX console credentials
JBOSS_ADMIN_USER=${JBOSS_ADMIN_USER:-"admin"}
JBOSS_ADMIN_PASS=${JBOSS_ADMIN_PASS:-"admin"}
ADMIN_USER_OPT="-u $JBOSS_ADMIN_USER"
ADMIN_PASS_OPT="-p $JBOSS_ADMIN_PASS"

#define the classpath for the shutdown class
JBOSSCP=${JBOSSCP:-"$JBOSS_HOME/bin/shutdown.jar:$JBOSS_HOME/client/jnet.jar"}

#define the script to use to start jboss
JBOSSSH=${JBOSSSH:-"$JBOSS_HOME/bin/run.sh -c $JBOSS_CONF"}

if [ "$JBOSS_USER" = "RUNASIS" ]; then
  SUBIT=""
else
  SUBIT="su - $JBOSS_USER -c "
fi

if [ -n "$JBOSS_CONSOLE" -a ! -d "$JBOSS_CONSOLE" ]; then
  # ensure the file exists
  touch $JBOSS_CONSOLE
  if [ ! -z "$SUBIT" ]; then
    chown $JBOSS_USER $JBOSS_CONSOLE
  fi
fi

if [ -n "$JBOSS_CONSOLE" -a ! -f "$JBOSS_CONSOLE" ]; then
  echo "WARNING: location for saving console log invalid: $JBOSS_CONSOLE"
  echo "WARNING: ignoring it and using /dev/null"
  JBOSS_CONSOLE="/dev/null"
fi

#define what will be done with the console log
JBOSS_CONSOLE=${JBOSS_CONSOLE:-"/dev/null"}

JBOSS_CMD_START="cd $JBOSS_HOME/bin; $JBOSSSH"
JBOSS_CMD_STOP=${JBOSS_CMD_STOP:-"java -classpath $JBOSSCP org.jboss.Shutdown --shutdown $ADMIN_USER_OPT $ADMIN_PASS_OPT"}

if [ -z "`echo $PATH | grep $JAVAPTH`" ]; then
  export PATH=$PATH:$JAVAPTH
fi

if [ ! -d "$JBOSS_HOME" ]; then
  echo JBOSS_HOME does not exist as a valid directory : $JBOSS_HOME
  exit 1
fi

echo JBOSS_CMD_START = $JBOSS_CMD_START

case "$1" in
start)
    cd $JBOSS_HOME/bin
    if [ -z "$SUBIT" ]; then
        eval $JBOSS_CMD_START >${JBOSS_CONSOLE} 2>&1 &
        ##$JBOSSSH
    else
        $SUBIT "$JBOSS_CMD_START >${JBOSS_CONSOLE} 2>&1 &"
    fi
    ;;
stop)
    if [ -z "$SUBIT" ]; then
        $JBOSS_CMD_STOP
    else
        $SUBIT "$JBOSS_CMD_STOP"
    fi
    ;;
restart)
    $0 stop
    $0 start
    ;;
*)
    echo "usage: $0 (start|stop|restart|help)"
esac


ttkrpink

unread,
Oct 7, 2014, 12:52:06 PM10/7/14
to
For those who have the same problem, I use the update-rc to solve this problem.

sudo update-rc.d /etc/init.d/dcm4chee_init_redhat.sh defaults

Docjay

unread,
Nov 19, 2014, 10:19:58 AM11/19/14
to dcm...@googlegroups.com
is DCM4CHEE running on a port < 1024?  If so, then those low ports are for root only.  I run CENTOS7 and ours is running on port 104.  I successfully used 'authbind' to when my service starts to open up that port.
Reply all
Reply to author
Forward
0 new messages