Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how can I start a process, logout, and come back with it still running

Status
Not open for further replies.

LuxFX

Programmer
Jun 25, 2001
2
US
*NIX is pretty foreign to me, but I'm experimenting with my Java programming, and I need to setup a (chat server) process that will stay running. So far I'm using the 'nohup' command and viola - the java job will stay on after I log off (via SSH to my hosting service). But every time I log back in, it shuts down the service. How can I keep the service going, and be able to hop back into it when I log back in?

hope this was clear!
-cheers
david
 
Use nohup command (text from manpage follows):

NAME nohup - run a command immune to hangups, with output to a non-tty

SYNOPSIS
nohup COMMAND [ARG]...
nohup OPTION

DESCRIPTION
Run COMMAND, ignoring hangup signals.

--help display this help and exit

--version
output version information and exit

d3funct
zimmer.jon@cfwy.com
The software required `Windows 95 or better', so I installed Linux.

 
thanks d3funct, but I've tried that. the problem was that logging in again killed the nohup process for some reason. I want to be able to re-login and retain the process.
 
Hi,

that sounds very strange, because logging into your account should not affect your server prog started in a previous session.

Do you use a publicly available server or was it a developement of your own? A server process should not be linked in any way to a "real-user"-session, instead it should be started when the system reaches the corresponding runlevel without user-interaction.

I have no idea of java-programming, but there should be a way of detaching the process from the controlling terminal and putting itself into the background, like a "normal" c-written server-process does.

ciao,
mbr
 
I would be talking to the hosting service - sounds like they're doing something funny as you login. Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
Actually you want:

nice nohup COMMAND &

where COMMAND is the command you're using to start the process.
 
Sorry, I think that's a red-herring - I still think you ought to talk to your hosting service. Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top