<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><blockquote type="cite"><a href="http://www.jboss.org/community/docs/DOC-12305"></a></blockquote>I refer to the following link to setup JBOSS run as a service.&nbsp;<br><blockquote type="cite"><a href="http://www.jboss.org/community/docs/DOC-12305">http://www.jboss.org/community/docs/DOC-12305</a><br></blockquote><blockquote type="cite">How do I Start JBoss on boot with Linux?</blockquote></div><div><br></div>I tried both script on this page and the one under jboss-4.0.5.GA/bin/jboss_init_redhat.sh. When I do (ps -ef | grep jboss), no process shows up. I would be really appreciate if someone can give me some advice.<div>Thanks,</div><div>Below is my script. I masked the ip address.&nbsp;<div><div><br></div><div>#!/bin/sh</div><div><br></div></div><div><div>JBOSS_HOME=${JBOSS_HOME:-"/srv/caGrid/lsd/apps/ncia4/jboss-4.0.5.GA/"}</div><div><br></div><div>#define the user under which jboss will run, or use 'RUNASIS' to run as the current user</div><div>JBOSS_USER=${JBOSS_USER:-"jboss"}</div><div><br></div><div>#make sure java is in your path</div><div>#JAVAPTH=${JAVAPTH:-"/usr/java/jdk1.5.0_16/bin"}</div><div>JAVAPTH=${JAVAPTH:-"$JAVA_HOME/bin"}</div><div><br></div><div>#configuration to use, usually one of 'minimal', 'default', 'all'</div><div>JBOSS_CONF=${JBOSS_CONF:-"default"}</div><div><br></div><div>#bind address for jboss services, by default bind to *all* NICs</div><div>JBOSS_HOST=${JBOSS_HOST:-"140.xxx.xxx.xx"}</div><div><br></div><div>#define the classpath for the shutdown class</div><div>JBOSSCP=${JBOSSCP:-"$JBOSS_HOME/bin/shutdown.jar:$JBOSS_HOME/client/jnet.jar"}</div><div><div>#define the script to use to start jboss</div><div>JBOSSSH=${JBOSSSH:-"$JBOSS_HOME/bin/run.sh -c $JBOSS_CONF -b $JBOSS_HOST"}</div><div><br></div><div>if [ "$JBOSS_USER" = "RUNASIS" ]; then</div><div>&nbsp;&nbsp;SUBIT=""</div><div>else</div><div>&nbsp;&nbsp;SUBIT="su - $JBOSS_USER -c "</div><div>&nbsp;&nbsp;echo $SUBIT</div><div>fi</div><div><br></div><div>if [ -n "$JBOSS_CONSOLE" -a ! -d "$JBOSS_CONSOLE" ]; then</div><div>&nbsp;&nbsp;# ensure the file exists</div><div>&nbsp;&nbsp;touch $JBOSS_CONSOLE</div><div>&nbsp;&nbsp;if [ ! -z "$SUBIT" ]; then</div><div>&nbsp;&nbsp; &nbsp;chown $JBOSS_USER $JBOSS_CONSOLE</div><div>&nbsp;&nbsp;fi</div><div>fi</div><div><br></div><div>if [ -n "$JBOSS_CONSOLE" -a ! -f "$JBOSS_CONSOLE" ]; then</div><div>&nbsp;&nbsp;echo "WARNING: location for saving console log invalid: $JBOSS_CONSOLE"</div><div>&nbsp;&nbsp;echo "WARNING: ignoring it and using /dev/null"</div><div>&nbsp;&nbsp;#JBOSS_CONSOLE="$JBOSS_HOME/log/jboss.log"</div><div>&nbsp;&nbsp;JBOSS_CONSOLE=${JBOSS_CONSOLE:-"$JBOSS_HOME/log/jboss.log"}</div><div>fi</div><div><br></div><div>#define what will be done with the console log</div><div>JBOSS_CONSOLE=${JBOSS_CONSOLE:-"$JBOSS_HOME/log/jboss.log"}</div><div>echo $JBOSS_CONSOLE</div><div><br></div><div>JBOSS_CMD_START="cd $JBOSS_HOME/bin; $JBOSSSH"</div><div>JBOSS_CMD_STOP=${JBOSS_CMD_STOP:-"java -classpath $JBOSSCP org.jboss.Shutdown --shutdown"}</div><div><br></div><div>if [ -z "`echo $PATH | grep $JAVAPTH`" ]; then</div><div><div>export PATH=$PATH:$JAVAPTH</div><div>fi</div><div><br></div><div>if [ ! -d "$JBOSS_HOME" ]; then</div><div>&nbsp;&nbsp;echo JBOSS_HOME does not exist as a valid directory : $JBOSS_HOME</div><div>&nbsp;&nbsp;exit 1</div><div>fi</div><div><br></div><div>echo JBOSS_CMD_START = $JBOSS_CMD_START</div><div><br></div><div>case "$1" in</div><div>start)</div><div>&nbsp;&nbsp; &nbsp;echo "JBoss start.........."</div><div>&nbsp;&nbsp; &nbsp;cd $JBOSS_HOME/bin</div><div>&nbsp;&nbsp; &nbsp;if [ -z "$SUBIT" ]; then</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;eval $JBOSS_CMD_START >${JBOSS_CONSOLE} 2>&amp;1 &amp;</div><div>&nbsp;&nbsp; &nbsp;else</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;$SUBIT "$JBOSS_CMD_START >${JBOSS_CONSOLE} 2>&amp;1 &amp;"</div><div>&nbsp;&nbsp; &nbsp;echo "hi"</div><div>&nbsp;&nbsp; &nbsp;fi</div><div>&nbsp;&nbsp; &nbsp;;;</div><div>stop)</div><div>&nbsp;&nbsp; &nbsp;if [ -z "$SUBIT" ]; then</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;$JBOSS_CMD_STOP</div><div>&nbsp;&nbsp; &nbsp;else</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;$SUBIT "$JBOSS_CMD_STOP"</div><div>&nbsp;&nbsp; &nbsp;fi</div><div>&nbsp;&nbsp; &nbsp;;;</div><div>restart)</div><div>&nbsp;&nbsp; &nbsp;$0 stop</div><div>&nbsp;&nbsp; &nbsp;$0 start</div><div>&nbsp;&nbsp; &nbsp;;;</div><div>*)</div><div><div>&nbsp;&nbsp; &nbsp;echo "usage: $0 (start|stop|restart|help)"</div><div>esac</div></div></div></div><div><br></div></div></div></body></html>