--
YurySmirnov - 04-Oct-2011
Working with screen on lxplus
1. Creating new screen:
screen
2. Disconnecting from all screens keeping them running in background:
Ctrl+a d
We're now in regular session:
[detached]
appears.
3. Now we can disconnect from regular session and then log in again. (note that you have to log in to the same lxplus node - make sure you remember which one you were in before!)
This way all jobs working in screens will remain active.
screen -ls
will show all your active screens, e.g.
[login@machinename]/mydir% screen -ls
There is a screen on:
36713.pts-21.machinename (Detached)
2794.pts-33.machinename (Detached)
2 Sockets in /var/run/screen/S-login.
[login@machinenmae]/mydir%
will appear.
4. As explained
here
, you should take extra care of the Kerberos tokens. These expire as soon as you close the
ssh
connection of the parent session, and no I/O operations will be possible in that
screen
session of yours. To prevent this from happening, do
kinit
right after you created a
screen
session, that is
$ screen
# now inside the screen session
$ kinit
5. Now say we want to reconnect to second screen:
screen -r 2794.pts-33.machinename
(or simply
screen -r 2794
) (in case you have only 1 running screen you can simply type
screen -r
without any screen id indication!)
6. To destroy current (or all your existing screens - to be checked) screen and stop all running jobs in there press
Ctrl+d
while in screen.
If you've have some screen running for >~ 12 h please kill it - otherwise you'll get "AFS token expired"
7. To kill attached screen, e.g.
36713.pts-21.machinename (Attached)
do
kill 36713
8. In case screen got frozen kill it and then wipe screens list:
kill 36713
screen -wipe