LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-07-2005, 07:37 PM   #1
redijedi
LQ Newbie
 
Registered: Apr 2005
Posts: 8

Rep: Reputation: 0
Daemon User


I'm a Linux noob, but have been working with JBoss for a while now on windows. I am trying to follow JBoss's doc on getting the server to run as a service. I am attempting to create a user for this daemon. I believe I have it correct, yet when I attemp to run the service script I get the following:

[root@localhost opt]# /opt/jboss-4.0.1sp1/bin/jboss_init_redhat.sh start
CMD_START = cd /opt/jboss-4.0.1sp1/bin; /opt/jboss-4.0.1sp1/bin/run.sh -c all
su: warning: cannot change directory to /opt/jboss-4.0.1sp1/bin: Permission denied
This account is currently not available.

My thought is that this has something to do with the jbossd user account that I created.

From etc/passwd:
jbossd:x:501:3:JBoss Server:/opt/jboss-4.0.1sp1/bin:/sbin/nologin

Thanks,
T
 
Old 04-07-2005, 09:15 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
What are the permissions on /opt/jboss-4.0.1sp1/bin -- you can do "ls -ld /opt/jboss-4.0.1sp1/bin" (no quotes) to see them.
 
Old 04-07-2005, 09:20 PM   #3
redijedi
LQ Newbie
 
Registered: Apr 2005
Posts: 8

Original Poster
Rep: Reputation: 0
Thanks for the quick reply. I have been messing with chown and chmod on these dirs with -R. Here's the latest:

drwxr-x--- 2 jbossd root 4096 Apr 7 17:30 /opt/jboss-4.0.1sp1/bin
 
Old 04-10-2005, 11:45 AM   #4
redijedi
LQ Newbie
 
Registered: Apr 2005
Posts: 8

Original Poster
Rep: Reputation: 0
I figured out that my jboss user was the problem. Now, however I still can't get JBoss started. I keep getting:

[root@localhost init.d]# service jbossd start
CMD_START = cd /usr/local/jboss-4.0.1sp1/bin; /usr/local/jboss-4.0.1sp1/bin/run.sh -c all

That's all. Nothing starts. Just this output.

Thanks
 
Old 04-10-2005, 12:23 PM   #5
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
Normally when daemons start they don't print any sort of messages. You can do ps aux and look for the JBoss process to see if it's running. You can use netstat too to make sure it's listening on the correct port. If it's not, you should probably look at the logfiles the application generates. There may also be a verbose output option you can start it with that might give a better clue about the problem -- you'll have to consult the documentation.
 
Old 04-10-2005, 02:10 PM   #6
redijedi
LQ Newbie
 
Registered: Apr 2005
Posts: 8

Original Poster
Rep: Reputation: 0
Unfortunately, there is little documentation other than the script provided by JBoss. I've done quite a bit of googling on this topic with little results. ps aux does not show it running. netstat does not show it listening. The JBoss logs do not seem to have been touched. I don't think it's doing anything.

The output is coming from the JBoss start up file, but that seems to be all it's doing.

Below is the script provided by JBoss with my alterations:

Code:
#!/bin/sh
#
# JBoss Control Script
#
# chkconfig: 3 80 20
# description: JBoss EJB Container
# 
# To use this script
# run it as root - it will switch to the specified user
# It loses all console output - use the log.
#
# Here is a little (and extremely primitive) 
# startup/shutdown script for RedHat systems. It assumes 
# that JBoss lives in /usr/local/jboss, it's run by user 
# 'jboss' and JDK binaries are in /usr/local/jdk/bin. All 
# this can be changed in the script itself. 
# Bojan 
#
# Either amend this script for your requirements
# or just ensure that the following variables are set correctly 
# before calling the script

# [ #420297 ] JBoss startup/shutdown for RedHat

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

#make java is on your path
JAVAPTH=${JAVAPTH:-"/usr/java/jdk1.5.0_02/bin"}

#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 all"}

if [ -n "$JBOSS_CONSOLE" -a ! -d "$JBOSS_CONSOLE" ]; then
  # ensure the file exists
  touch $JBOSS_CONSOLE
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"}

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

CMD_START="cd $JBOSS_HOME/bin; $JBOSSSH" 
CMD_STOP="java -classpath $JBOSSCP org.jboss.Shutdown --shutdown"

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

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 CMD_START = $CMD_START


case "$1" in
start)
    cd $JBOSS_HOME/bin
    if [ -z "$SUBIT" ]; then
        eval $CMD_START >${JBOSS_CONSOLE} 2>&1 &
    else
        $SUBIT "$CMD_START >${JBOSS_CONSOLE} 2>&1 &" 
    fi
    ;;
stop)
    if [ -z "$SUBIT" ]; then
        $CMD_STOP
    else
        $SUBIT "$CMD_STOP"
    fi 
    ;;
restart)
    $0 stop
    $0 start
    ;;
*)
    echo "usage: $0 (start|stop|restart|help)"
esac
 
Old 03-06-2006, 07:48 AM   #7
allanpro
LQ Newbie
 
Registered: Mar 2006
Posts: 1

Rep: Reputation: 0
I had the same problem.

The solution to me was to change this:

Code:
JBOSSSH=${JBOSSSH:-"$JBOSS_HOME/bin/run.sh -c all"}
to this:

Code:
JBOSSSH=${JBOSSSH:-"$JBOSS_HOME/bin/run.sh"}
As I have only the default server installed (via the JBoss installer.jar).
 
Old 06-15-2006, 05:49 PM   #8
schultzg
LQ Newbie
 
Registered: Jun 2006
Posts: 1

Rep: Reputation: 0
-->I figured out that my jboss user was the problem. Now, however I still can't get JBoss started. I keep getting:

I am having the same problem "This account is not currently available". Can you explain what was actually done to fix the jboss user on your system?
 
Old 10-30-2006, 02:48 PM   #9
geniepower
LQ Newbie
 
Registered: Oct 2006
Posts: 2

Rep: Reputation: 0
Hi Guys,

I have got mine working. - CENTOS 4.4, jdk.1.5.0_08, jboss-4.0.4.GA

Simplied answer is:

I installed jboss in /opt ie /opt/jboss-4.0.4.GA

Copy the jboss_init_redhat.sh as jboss in init.d
# cp /opt/jboss-4.0.4.GA/bin/jboss_init_redhat.sh /etc/init.d/jboss

Code:
Change the following lines in the jboss
#define where jboss is - this is the directory containing directories log, bin, conf etc
JBOSS_HOME=${JBOSS_HOME:-"/opt/jboss-4.0.4.GA"}
                          ~~~~~~~~~~~~~~~~~~~

#make java is on your path
JAVAPTH=${JAVAPTH:-"/usr/java/jdk.1.5.0_08"}
                    ~~~~~~~~~~~~~~~~~~~~~~

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

#define the user under which jboss will run, or use RUNASIS to run as the current user
JBOSSUS=${JBOSSUS:-"root"}
                    ~~~~

And copied the start bit as status also. See below. Then SAVE File.

case "$1" in
start)
    cd $JBOSS_HOME/bin
    if [ -z "$SUBIT" ]; then
        eval $CMD_START >${JBOSS_CONSOLE} 2>&1 &
    else
        $SUBIT "$CMD_START >${JBOSS_CONSOLE} 2>&1 &" 
    fi
    ;;
status)
    cd $JBOSS_HOME/bin
    if [ -z "$SUBIT" ]; then
        eval $CMD_START >${JBOSS_CONSOLE} 2>&1 &
    else
        $SUBIT "$CMD_START >${JBOSS_CONSOLE} 2>&1 &" 
    fi
    ;;
stop)
    if [ -z "$SUBIT" ]; then
        $CMD_STOP
    else
        $SUBIT "$CMD_STOP"
    fi 
    ;;
restart)
    $0 stop
    $0 start
    ;;
*)
    echo "usage: $0 (start|stop|restart|help)"
esac
On the menu,
goto Server Settings->Services, enter root password.
goto Actions->Add Service
enter jboss
click on the checkbox for jboss, save.
Reboot the server.

Give enough time for the jboss to complete it's startup and test.

Enjoy
 
Old 10-30-2006, 02:50 PM   #10
geniepower
LQ Newbie
 
Registered: Oct 2006
Posts: 2

Rep: Reputation: 0
Please let me know if it works for you.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Daemon User redijedi Linux - General 1 04-07-2005 07:44 PM
Starting mysql daemon as user rather than root arubin Slackware 8 05-10-2004 04:03 PM
Getting Fetchmail to poll multiple user accounts in daemon mode davidbalt Linux - Newbie 0 02-23-2004 05:21 PM
gift daemon runs as root not as user... (using apollon and the fasttrack network) skinpainting Linux - Software 1 02-03-2004 02:43 AM
Making a Daemon User Road Linux - General 4 07-10-2002 01:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration