• Post Reply Bookmark Topic Watch Topic
  • New Topic

Running the service separately from the terminal session (URGENT)  RSS feed

 
sridevi kumar
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am new to UNIX. Starting today. I had written client and server programs in java (dos based). Now, i want to port that to UNIX.
1) How to start a terminal session?
2) What command should i give to start the server and client programs (in dos, it is java prog-name for both client and server). In UNIX, what is the command? Is there diff commands for
server and client?
3) In the terminal session, once the server is started, it should run as a separate service even the terminal session is closed. How to make this?
Thanks a lot.
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sridevi -
1) What flavor of Unix are we talking about?
2) The commands to run Java code are the same: $ java [Main-class]
3) Use the nohup command, and start the process in the background. nohup intercepts the 'hangup' signal the process would receive when the terminal session dies. Putting the job in the background gives you control of the session so you can exit. It would look like this:
$ nohup java [Main-class] &
------------------
Michael Ernest, co-author of: The Complete Java 2 Certification Study Guide
[This message has been edited by Michael Ernest (edited October 18, 2001).]
 
sridevi kumar
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Michael Ernest,
Thanks a lot. Now, i had learnt to a certain extent UNIX commands
Once again, thank you very much.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!