Solved

Run Embedded Jetty Server in Background on Linux

Posted on 2012-03-14
2
1,084 Views
Last Modified: 2012-03-15
Hello,

I'm using a ssh session on a Linux server to start an Embedded Jetty Server to run a web application that exposes web services. When I use the java -jar start.jar to bring up the Jetty web server instance I don't have access to the command line in that session and must open up a new ssh session in order to run a command line application that invokes the web services running on the jetty instance. Is there any way to run jetty in the background and in the same ssh session have access to the command line?
0
Comment
Question by:cgray1223
2 Comments
 
LVL 11

Accepted Solution

by:
legolasthehansy earned 500 total points
ID: 37726205
Try this,

If you are running the SSH session remotely,
nohup <java command> &

This runs the command in the background so that you can access the console/session for doing your work. Closing the session wouldn't terminate the program. If you want to terminate it you will need to find the process ID and send the KILL signal.
You can avoid all this and simply run,
<java command> & 
and it would terminate if you close the session.
0
 

Author Comment

by:cgray1223
ID: 37727932
I used java -jar start.jar &>/dev/null & but your solution would work as wel.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question