LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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, 07: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, 08:03 PM   #2
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.6, Centos 5.10
Posts: 16,324

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


nohup yourprog &

 
Old 11-09-2005, 08: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, 10:37 PM   #4
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.6, Centos 5.10
Posts: 16,324

Rep: Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041
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, 12:22 PM   #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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 01:05 PM
SSH sessions locked to one program jav Linux - Software 2 11-17-2004 11:06 AM
limiting ssh sessions for a given user breenbaron Linux - Security 2 03-16-2004 11:20 AM
dead ssh sessions babroga Linux - Networking 3 03-03-2002 07:43 PM
dead ssh sessions babroga Linux - Newbie 1 03-03-2002 09:16 AM


All times are GMT -5. The time now is 12:02 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration