[jboss-user] [Installation, Configuration & DEPLOYMENT] - JBoss AS 4.2.3 start as service question
wslyhbb
do-not-reply at jboss.com
Thu Aug 21 20:57:59 EDT 2008
I have JBoss AS 4.2.3, if I start it as a service at boot, JBoss starts but Tomcat does not. However, I can start it manually by running run.sh and it all works correctly. What I mean is, if I boot the computer, then I can go to http://localhost:8080 and the JBoss page is displayed. If I click on any of the JBoss Management links (Tomcat, JMX Console, or JBoss Web Console) I get an "Unable to connect" error.
Please help.
Here is my /etc/rc.d/init.d/jboss:
#! /bin/sh
JBOSS_LOG_FILE=/var/log/jboss
JBOSS_HOME=${JBOSS_HOME:-"/usr/local/jboss-4.2.3.GA"}
start(){
echo "Starting jboss.."
# If using an SELinux system such as RHEL 4, use the command below
# instead of the "su":
# eval "runuser - jboss -c '/opt/jboss/current/bin/run.sh > /dev/null 2> /dev/null &'
# if the 'su -l ...' command fails (the -l flag is not recognized by my su cmd) try:
# sudo -u jboss /opt/jboss/bin/run.sh > /dev/null 2> /dev/null &
su -l jboss -c '$JBOSS_HOME/bin/run.sh 2>&1 $JBOSS_LOG_FILE &'
}
stop(){
echo "Stopping jboss.."
# If using an SELinux system such as RHEL 4, use the command below
# instead of the "su":
# eval "runuser - jboss -c '/opt/jboss/current/bin/shutdown.sh -S &'
# if the 'su -l ...' command fails try:
# sudo -u jboss /opt/jboss/bin/shutdown.sh -S &
su -l jboss -c '$JBOSS_HOME/bin/shutdown.sh -S &'
}
restart(){
stop
# give stuff some time to stop before we restart
sleep 60
# protect against any services that can't stop before we restart (warning this kills all Java instances running as 'jboss' user)
su -l jboss -c 'killall java'
# if the 'su -l ...' command fails try:
# sudo -u jboss killall java
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
*)
echo "Usage: jboss {start|stop|restart}"
exit 1
esac
exit 0
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4171922#4171922
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4171922
More information about the jboss-user
mailing list