LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-09-2005, 06:10 PM   #1
frokid879
LQ Newbie
 
Registered: Feb 2004
Posts: 3

Rep: Reputation: 0
SSH help, concerning sessions


I have a linux box in my closet which i control by ssh. I would like it to run a process for me, so i put "# process &" to make it run in the background. However, when i close putty (on my desktop machine) it ends the session including my process, even though it is running in the background. How can i close putty (ending my session) but keep my process going?
 
Old 11-09-2005, 07:03 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
you need nohup ... ie


nohup yourprog &

 
Old 11-09-2005, 07:59 PM   #3
frokid879
LQ Newbie
 
Registered: Feb 2004
Posts: 3

Original Poster
Rep: Reputation: 0
can i use it w/o the & and not run it in the background but have it always on when i make a new session?
 
Old 11-09-2005, 09:37 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
nohup disconnects it from the session (which is why it persists when you logoff).
There's no (easy) way to re-connect that I know offhand.. maybe someone else does.
What exactly are you trying to do here?
If you don't use '&' it would tie up the session/cmd line if you could re-connect to it anyway...
Frankly, I'd use my suggestion as before, but make it write to a logfile regularly if you want to monitor it's progress.
 
Old 11-11-2005, 11:22 AM   #5
apepost
Member
 
Registered: Oct 2003
Distribution: Fedora core 4
Posts: 113

Rep: Reputation: 15
As soon as you connect the first time, Type "screen".
When your done, just disconnect the way you normally do.
Then, when you want to come back and look at your session, Type "screen -d -RR .

When you want to end the session forever, type exit.

I just found about about screen, but I now use it regularly to download bittorrents with my server.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[priv] in SSH Sessions stefaandk Linux - Security 2 09-22-2006 12:05 PM
SSH sessions locked to one program jav Linux - Software 2 11-17-2004 10:06 AM
limiting ssh sessions for a given user breenbaron Linux - Security 2 03-16-2004 10:20 AM
dead ssh sessions babroga Linux - Networking 3 03-03-2002 06:43 PM
dead ssh sessions babroga Linux - Newbie 1 03-03-2002 08:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration