Does GNU Screen have a server-client architecture model?

Is each Screen session a Screen client process?

Why can't I find out the Screen server process, but only its session processes i.e. client processes? (I suppose both Screen server and client processes contain a substring screen in their names up to cases)

$ sudo netstat -a | grep -i screen
[sudo] password for t: 
unix  2      [ ACC ]     STREAM     LISTENING     2807736  /run/screen/S-testme/3341.testme
unix  2      [ ACC ]     STREAM     LISTENING     2809282  /run/screen/S-testme/3875.tm
unix  2      [ ACC ]     STREAM     LISTENING     4533106  /run/screen/S-t/27525.test

$ ps aux | grep -i [s]creen
testme    3341  0.0  0.0  45416  2428 ?        Ss   Nov30   0:00 SCREEN -S testme
testme    3875  0.0  0.0  38860  2380 ?        Ss   Nov30   0:00 SCREEN -S tm
t        27525  0.0  0.0  45828  3740 ?        Ss   07:22   0:00 SCREEN -S test

How can I find out the Screen server process?



Each Screen session is its own “server”; these are the “SCREEN” processes, and they are the processes which continue running when you detach from a session. The “client” is a “screen” process which connects to the corresponding session and allows you to interact with it; these are short-lived (relatively speaking), and only last as long as they are attached to a session.

You can see all your current user’s running sessions with

screen -ls

This will show the process identifiers, tty and host of all the available sessions.

ps -fC screen

will show all the running screen processes, both sessions and clients.

  • Thanks. Does ps show the Screen client processes? How can I find out the Screen client processes? – Tim Dec 4 '18 at 15:55
  • Ok, I see, when I detach a session, its client process is killed. When I reattach a session, a new client process is created. – Tim Dec 4 '18 at 16:03
sudo screen -list 

you can find the screen process Id

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.