-
1. Re: JBOSS runs as a service, but will not autostart
peterj Sep 30, 2009 12:18 PM (in response to geneellis)What account are you using to run the service? Does that account have full rights to the jboss-xxx directory and its subdirectories?
What version of JBoss AS and which OS? -
2. Re: JBOSS runs as a service, but will not autostart
geneellis Sep 30, 2009 12:27 PM (in response to geneellis)Thank you for your reply.
I am using root when I manually start the service from command line. I am also using the command sudo -u root /path/to/jboss/bin/run.sh -b 0.0.0.0 in side the JBOSS (service) file.
Jboss Version: 4.2.2.GA
OS is CentOS -
3. Re: JBOSS runs as a service, but will not autostart
peterj Sep 30, 2009 12:32 PM (in response to geneellis)Are you redirecting stdout/stderr when invoking run.sh to a file? Does the file give any hints? Is there anything in the log files?
-
4. Re: JBOSS runs as a service, but will not autostart
geneellis Sep 30, 2009 12:37 PM (in response to geneellis)Hey Peter,
No I am not redirecting stout/stderr if I am understanding you correctly. What is the exact procedure for examining the logs?
Thanks again. -
5. Re: JBOSS runs as a service, but will not autostart
peterj Sep 30, 2009 1:22 PM (in response to geneellis)So after you changed the script to redirect stdout/stderr to a file (hint, hint), what did you find out?
I probably should have been more specific and stated "JBoss AS log files" -
6. Re: JBOSS runs as a service, but will not autostart
geneellis Sep 30, 2009 1:25 PM (in response to geneellis)I will let you know. I know a bit about Unix, but there are parts I am still learning. I don't know how to change that, but I will google it. Also, keep in mind, this script runs fine when I execute it from command line. Even when I make it a service. The only thing not happening is when I restart my server, the service isn't automatically started.
-
7. Re: JBOSS runs as a service, but will not autostart
peterj Sep 30, 2009 1:35 PM (in response to geneellis)Yes, I understand all that, but "weird" things happen when services start automatically at startup. What I am suspecting is that the OS does attempt to start the service, but it is crashing for some reason. I imagine there is an OS log file somewhere that might give some clues on the issue, but I would not know offhand. And even if I knew where that log was on Ubuntu , such knowledge might not help you on CentOS. So the best alternative is to have the script "echo" so info.
If you are using one of the jboss_init_*.sh scripts, then you will see this:JBOSS_CONSOLE=${JBOSS_CONSOLE:-"/dev/null"} . . . eval $JBOSS_CMD_START >${JBOSS_CONSOLE} 2>&1 &
in which case all you have to do is change the /dev/null to something a little more permanent ;-) Or set JBOSS_CONSOLE earlier script - there are some 'if' statements earlier in the script that ensure the files is accessible, so set it before those statements. And of course test manually first. -
8. Re: JBOSS runs as a service, but will not autostart
geneellis Sep 30, 2009 1:39 PM (in response to geneellis)Ok I see. I will make this changes tonight and let you know what I find. I am not using that exact script, but a simplified version. Basically this one:
#! /bin/sh 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 '/opt/jboss/current/bin/run.sh > /dev/null 2> /dev/null &' } 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 '/opt/jboss/current/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
Thanks so much for your help!