[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

09/17/2006 at 11:45AM PDT, ID: 21992542
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.8

jboss startup script throws "command not found" error on redhat

Asked by angelzworld in Application Servers

Tags: jboss, command, startup

This is my startup script to start jboss on boot on redhat

*********************************************************
#! /bin/sh

# chkconfig: 345 89 60
# description: startup script for jboss

ECHO=/bin/echo
TEST=/usr/bin/test
JBOSS_START_SCRIPT=/opt/jboss-4.0.3SP1/bin/run.sh -Djava.awt.headless=true
JBOSS_STOP_SCRIPT=/opt/jboss-4.0.3SP1/bin/shutdown.sh

$TEST -x $JBOSS_START_SCRIPT || exit 0
$TEST -x $JBOSS_STOP_SCRIPT || exit 0

depend() {
        need local
}


start() {
      $ECHO –n "Starting JBoss"
      source /etc/profile
      runuser - jboss -c "$JBOSS_STOP_SCRIPT" > /dev/null 2> /dev/null &"
      $ECHO "."
}

stop() {
      $ECHO –n "Stopping JBoss"
      runuser - jboss -c "$JBOSS_STOP_SCRIPT -S > /dev/null $"
      $ECHO "."
}

case "$1" in
      start)
            start
            ;;
      stop)
            stop
            ;;
      restart)
            stop
            sleep 60
            start
            ;;
      *)
            $ECHO "Usage: jboss {start|stop|restart}"
            exit 1
esac
***********************************************************************
When I run jboss start from the prompt , I am getting this error

[root@localhost ~]# service jbossd start
/etc/init.d/jbossd: line 8: -Djava.awt.headless=true: command not found
â?"n Starting JBoss
.
***************************************************

if i type this at the prompt /opt/jboss-4.0.3SP1/bin/run.sh -Djava.awt.headless=true , jboss starts as needed.
I thought it was not able to get the path for java..however thats set in the environment variables. This is the output of my export command for user jboss

****************************************************************************
declare -x G_BROKEN_FILENAMES="1"
declare -x HISTSIZE="1000"
declare -x HOME="/home/jboss"
declare -x HOSTNAME="localhost"
declare -x INPUTRC="/etc/inputrc"
declare -x JAVA_HOME="/opt/j2sdk1.4.2_12"
declare -x KDEDIR="/usr"
declare -x LANG="en_US.UTF-8"
declare -x LESSOPEN="|/usr/bin/lesspipe.sh %s"
declare -x LOGNAME="jboss"
declare -x LS_COLORS=""
declare -x MAIL="/var/spool/mail/jboss"
declare -x OLDPWD
declare -x PATH="/opt/j2sdk1.4.2_12/bin:/opt/j2sdk1.4.2_12/lib:/opt/j2sdk1.4.2_1
2/jre/bin:/opt/j2sdk1.4.2_12/jre/javaws:/usr/kerberos/bin:/usr/local/bin:/bin:/u
sr/bin:/usr/X11R6/bin:/home/jboss/bin"
declare -x PWD="/home/jboss"
declare -x SHELL="/bin/bash"
declare -x SHLVL="1"
declare -x SSH_ASKPASS="/usr/libexec/openssh/gnome-ssh-askpass"
declare -x TERM="cygwin"
declare -x USER="jboss"
***************************************************************************
this is the ouput of the export command for root
************************************************************************
declare -x G_BROKEN_FILENAMES="1"
declare -x HISTSIZE="1000"
declare -x HOME="/root"
declare -x HOSTNAME="localhost"
declare -x INPUTRC="/etc/inputrc"
declare -x JAVA_HOME="/opt/j2sdk1.4.2_12"
declare -x KDEDIR="/usr"
declare -x LANG="en_US.UTF-8"
declare -x LESSOPEN="|/usr/bin/lesspipe.sh %s"
declare -x LOGNAME="root"
declare -x LS_COLORS=""
declare -x MAIL="/var/spool/mail/root"
declare -x OLDPWD
declare -x PATH="/opt/j2sdk1.4.2_12/bin:/opt/j2sdk1.4.2_12/lib:/opt/j2sdk1.4.2_1
2/jre/bin:/opt/j2sdk1.4.2_12/jre/javaws:/usr/kerberos/sbin:/usr/kerberos/bin:/us
r/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/b
in"
declare -x PWD="/root"
declare -x SHELL="/bin/bash"
declare -x SHLVL="1"
declare -x SSH_ASKPASS="/usr/libexec/openssh/gnome-ssh-askpass"
declare -x SSH_CLIENT="::ffff:10.1.1.103 1970 22"
declare -x SSH_CONNECTION="::ffff:10.1.1.103 1970 ::ffff:10.1.1.37 22"
declare -x SSH_TTY="/dev/pts/1"
declare -x TERM="cygwin"
declare -x USER="root"
***********************************************************************
I am sure I am missing soemthing very trivial...and my unix is a little rusty
why am i getting a command not found error??
[+][-]09/19/06 08:15 PM, ID: 17557890

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Application Servers
Tags: jboss, command, startup
Sign Up Now!
Solution Provided By: shinobun
Participating Experts: 1
Solution Grade: A
 
 
[+][-]10/13/06 03:27 PM, ID: 17728181

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]10/18/06 07:28 AM, ID: 17757093

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20090824-EE-VQP-74