Link to home
Start Free TrialLog in
Avatar of WAS
WASFlag for United States of America

asked on

start jboss server and run in back ground

i start the jboss app server with below command from putty session and let it run in background, but when i close my putty session the jboss server will be stopped. How make the jboss run in back ground with out interruption even when i disconnect my putty session.

/app/papa/jboss-5.1.0.GA/bin/run.sh -c all -b 192.77.88.129 &
Avatar of xterm
xterm

I would suggest creating a sysv init script which starts it at boot time, and then shuts it down cleanly before a reboot.  This is pretty simple to do (and you can you a cron to fire it up the first time so that you don't have to reboot to get it started)

If you tell me which OS you're running, I'll help you create it.
Avatar of WAS

ASKER

linux centos 5.7 (which is equalent to redhat5.7)
SOLUTION
Avatar of xterm
xterm

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Line #13 should be

    . /etc/sysconfig/jboss


Sorry, I copied another script to use as an example.  This won't affect it running, but please correct it anyway :)
Avatar of WAS

ASKER

it working but when i run /etc/init.d/jboss start it's starting the server and then it neve comes back to command prompt and if i close the puitty session it will kill the jboss server as my initial concern is.

and also when i do ctrl+Z  when it won't come back to prompt, the server goes down but i get below error

15:56:07,866 INFO  [HypersonicDatabase] Database standalone closed clean
15:56:11,265 INFO  [ServerImpl] Shutdown complete
Shutdown complete
Halting VM

touch: cannot touch `/var/lock/subsys/jboss': Permission denied
Put between line 24&25 this:

export LAUNCH_JBOSS_IN_BACKGROUND=1

Then try again, it should work.
Avatar of WAS

ASKER

now it runs even i disconnect my putty session, but it doesn't come back to unix prompt when run /etc/init.d/jboss start and when i do crtl+z i still get --> " touch: cannot touch `/var/lock/subsys/jboss': Permission denied"

and

i run jboss instance as webadmin user account, i noticed boot process it starting server as root process when i reboot the OS.

Just comment out the /var/lock/subsys lines in the script if you're not running it as root - you don't need them.

And don't worry about it not coming back to the prompt - it's working after you disconnect, which is what you wanted.

And the bonus is that from now on, it will start when you boot up too!
Avatar of WAS

ASKER

it works now....cool...what is this for "var/lock/subsys"

Thanks a lot for helping me out
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of WAS

ASKER

perfect it's starting as non-root user now. although the /etc/sbin/jboss start command still does run in background when i disconnect the putty seesion it will stop the jboss server.

But i am able to start the jboss from the boot