Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

you can see there are three processes which are related to screen command:

[world]$ ps auxf
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
hugemeow   28938  0.0  0.0  66080  1692 ?        S    23:03   0:00 sshd: hugemeow@pts/0
hugemeow   28941  0.0  0.0 102040  2172 pts/0    Ss   23:03   0:00  \_ -bash
**hugemeow   30231  0.0  0.0  19436  1172 pts/0    S+   23:08   0:00**      \_ tmux -L l a -d
hugemeow   15696  0.0  0.1 124804 18480 ?        S    22:18   0:01 php5.cgi
hugemeow   20388  0.0  0.0  19600  1376 ?        Ss   04:47   0:05 tmux -L l
hugemeow   20389  0.0  0.0 102064  2040 pts/2    Ss   04:47   0:00  \_ -bash
**hugemeow   20440  0.0  0.0 107424  1004 pts/2    S+   04:48   0:00**  |   \_ screen -dr l     //  1
hugemeow   20524  0.0  0.0 102060  2048 pts/3    Ss   04:48   0:00  \_ -bash
hugemeow   20534  0.0  0.0  18856  1148 pts/3    S+   04:48   0:01      \_ top
hugemeow    8257  0.0  0.0 107948   996 ?        Ss   Aug13   0:12 SCREEN -S cmd            //  2
hugemeow    8258  0.0  0.0 102084  1528 pts/11   Ss+  Aug13   0:00  \_ /bin/bash
hugemeow   25035  0.0  0.0 102076  2052 pts/1    Ss+  Aug14   0:00  \_ /bin/bash
**hugemeow   24542  0.0  0.0 108072  1040 ?        Ds   Aug13   0:21 SCREEN** -S l              //  3
hugemeow   24545  0.0  0.0 102124  1564 pts/8    Ss   Aug13   0:00  \_ /bin/bash
hugemeow   25589  0.0  0.0  18840  1160 pts/8    S+   Aug14   0:02  |   \_ top
hugemeow   25894  0.0  0.0 102124  1616 pts/9    Ss   Aug13   0:00  \_ /bin/bash
hugemeow   30249  0.0  0.0  98740  1008 pts/9    R+   23:08   0:00      \_ ps auxf

but when using screen -ls command, you can find there are only two screen process:( so why ps auxf shows 3 processes?

by the way, wy screen command have something to do with sockets?

screen -ls
There are screens on:
        8257.cmd        (08/13/2012 08:48:53 PM)        (Detached)
        24542.l (08/13/2012 07:52:30 PM)        (Attached)
2 Sockets in /var/run/screen/S-hugemeow


ls /dev/pts -l
total 0
crw--w---- 1 hugemeow   tty 136,  0 2012-08-15 23:15 0
crw--w---- 1 hugemeow   tty 136,  1 2012-08-14 11:08 1
crw--w---- 1 hugemeow   tty 136, 11 2012-08-14 11:06 11
crw------- 1 hugemeow   tty 136,  2 2012-08-15 23:15 2
crw--w---- 1 hugemeow   tty 136,  3 2012-08-15 23:15 3
crw--w---- 1 hugemeow   tty 136,  8 2012-08-15 23:15 8
crw--w---- 1 hugemeow   tty 136,  9 2012-08-15 23:15 9
share|improve this question

1 Answer 1

You kind of have to think of screen as if it was both a client and a server. When you start a new screen session you have the process acting as a client which you interact with and a second process that is the parent of any windows/programs you create/start. When you disconnect your client process closes.

On your system with three processes you have two screen sessions running, and one screen client connected to one of those sessions.

The screen sessions are the processes with SCREEN in all caps. The client process is the lower case version.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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