l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
October 20: Web Application Hacking: How to Make and Break Security on the Web
Next Installfest:
TBD
Latest News:
Oct. 10: LUGOD Installfests coming again soon
Page last updated:
2003 Oct 23 09:11

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] possible to exit ssh with a program running?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] possible to exit ssh with a program running?



On Thu, 23 Oct 2003 08:17:47 -0700, Jonathan Stickel <jjstickel@myrealbox.com> wrote:

I know that if I start a terminal window in X, run a program, and then manually close the window, the program dies. I also know that if I secure-shell into another machine and run a program, I cannot exit without first ending that program.

Is there any way to start a program for a shell window and leave it running when I close the window? Also, is there anyway to leave a program running remotely, started through an ssh session, and exit ssh?

The later would be very helpful, although I suspect these two issues are related. My research involves running computer simulations on several computers on campus. I would really like to ssh into the machines from home, start the simulations (which generate output to text files), and then exit the ssh sessions with the simulations in progress. This way I could close my internet connection (dial-up :( ) and turn my home computer off while the multi-day simulations run.
man screen

SCREEN(1) SCREEN(1)

NAME
screen - screen manager with VT100/ANSI terminal emulation

SYNOPSIS
screen [ -options ] [ cmd [ args ] ]
screen -r [[pid.]tty[.host]]
screen -r sessionowner/[[pid.]tty[.host]]

DESCRIPTION
Screen is a full-screen window manager that multiplexes a physical ter-
minal between several processes (typically interactive shells). Each
virtual terminal provides the functions of a DEC VT100 terminal and, in
addition, several control functions from the ISO 6429 (ECMA 48, ANSI
X3.64) and ISO 2022 standards (e.g. insert/delete line and support for
multiple character sets). There is a scrollback history buffer for
each virtual terminal and a copy-and-paste mechanism that allows moving
text regions between windows.

Screen lets you run a program (or programs) from inside it, and then detatch from screen, essentially sending it to the background, and then log out of the terminal while screen continues to run, keeping whatever was running within it going.

Another nice feature of screen is it can create multiple windows-I like to think of them as tabs, similar to how you can have multiple tabs in gnome-terminal. I can for instance ssh into server1, run screen, start a process, open a new tab, ssh to server2 in tab 2 and start a process there, open tab3 and ssh to server3...etc.

Now once you have all your processes going, detatch from screen, log out of server1, and close your internet connection. When you ssh back in to server1 a week later, run screen and reattach to the running session. All your tabs are still there, with your ssh connections still active.
_______________________________________________
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech



LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
Appahost Applications
For a significant contribution towards our projector, and a generous donation to allow us to continue meeting at the Davis Library.