0

I use GNOME desktop environment under FreeBSD. I had multiple tabs in GNOME terminal 2.26 and in each tab I had an ongoing screen(4.00.03) session. I logged into one of the remote servers with SSH and cat a large file and after a while, the screen session in GNOME terminal tab hanged. Output of pstree looks following:

$ pstree -p 1700
-+= 00001 root /sbin/init --
 \-+- 01506 martint gnome-terminal
   \-+= 01586 martin bash
     \-+= 01699 martin screen
       \-+= 01700 root screen

There are dozen of processes under PID 1700, which all, including PID 1700, are in idle state:

$ ps -p 01700 -o command,state
COMMAND          STAT
screen           Is  
$ 

I have disconnected the SSH session to remote server and also checked that the screen scrolling is unblocked. Is there a way to restore this screen session?

  • sysutils/tmux is a great screen alternative. – rmelcer Jul 6 '15 at 16:50
  • Maybe, but unfortunately it does not help to restore this idle screen session :) – Martin Jul 7 '15 at 8:02
2

You can issue detach before re-attaching from another terminal, e.g.:

$ screen -list
$ screen -d -r ...
  • I tried screen -ls from another terminal and it lists this idle screen session as "Attached". Now if I try to detach this screen with screen -d 1700.pts-0 from another terminal, then looks like screen -d 1700.pts-0 hangs and if I trace the system calls of this with truss -fp 23137(23137 is the PID of screen -d 1700.pts-0 command) from jet another terminal as a root user, then all I receive is a 23137: SIGNAL 17 (SIGSTOP) and truss shows no additional output. – Martin Jul 7 '15 at 8:00
  • @Martin, then you can try to send a SIGCONT to pid 23137 - and then try the remotely-detach/reattach sequence again. – maxschlepzig Jul 7 '15 at 9:27
  • I tried to detach this idle screen session named 1700.pts-0. multiple times, but unfortunately it does not detach. It simply stays with its Is state which according to FreeBSD ps manual means that process is idle(sleeping for longer than about 20 seconds) and process is a session leader. – Martin Jul 7 '15 at 14:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.