Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've been using Gnu screen for some time now, and I absolutely love it! I installed it on a second RHEL server of mine, and I'm seeing odd behavior when I issue a 'who' on the new server.

'who' shows me as logged in twice on the new server, but only once on my old server. I have identical configs as far as I can tell.

I use PuTTy from Windows to SSH to my RHEL servers. Shell is xterm. When I log-in I run screen then who and this is what I see:

Server 1 (old server):

svenglar@server1 ~$ who
<....>
svenglar pts/3    Oct 11 23:22 (tsv1.home.local)

Server 2 (new server):

svenglar@server2 ~$ who
<....>
svenglar pts/3    Oct 11 23:22 (tsv1.home.local)
svenglar pts/4    Oct 11 23:24 (:pts/2:S.0)

I've checked my /etc/bashrc, ~/.bashrc ~/.screenrc ~/.bash_profile, and they are all the same. I also have the same version of RHEL on both servers.

Anyone know what could be causing this?

share|improve this question

migrated from stackoverflow.com Oct 12 '12 at 9:56

This question came from our site for professional and enthusiast programmers.

4 Answers 4

Server 1 who-output look incorrect, because :S.0-like suffix should present if you have screen session.

Please show full who-output before and after screen-running.

share|improve this answer

May be you opened one more terminal at that time.

Try opening new terminals. You will see the difference in who output.

pts/X entries will be added per Terminal.

share|improve this answer

Okay, here's some more output of the two servers. They definitely show differences, but now I'm not too worried that one is wrong or not. It's just weird that they're different, and I'd like to know why.

[svenglar@server1 ~]$ who
svenglar pts/0      Oct 12 18:25    (tsv1.home.local)

[svenglar@server1 ~]$ screen -ls
No Sockets found in /var/run/screen/S-svenglar.

[svenglar@server1 ~]$ ps aux | grep svenglar
root       751  0.0  0.0  90172  3272 ?       Ss   18:25   0:00 sshd: svenglar [priv]
svenglar   757  0.0  0.0  90172  1828 ?       S    18:25   0:00 sshd: svenglar@pts/0
svenglar   758  0.0  0.0  10948  1584 pts/0   Ss   18:25   0:00 -bash
svenglar   822  0.0  0.0  10476   892 pts/0   R+   18:27   0:00 ps aux
svenglar   823  0.0  0.0   6052   576 pts/0   S+   18:27   0:00 grep svenglar

[svenglar@server1 ~]$ ps uxf
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
svenglar   757  0.0  0.0  90172  1828 ?        S    18:25   0:00 sshd: svenglar@pts/0
svenglar   758  0.0  0.0  10948  1584 pts/0    Ss   18:25   0:00  \_ -bash
svenglar   829  0.0  0.0  10472   848 pts/0    R+   18:27   0:00      \_ ps uxf

[svenglar@server1 ~]$ screen

[svenglar@server1 ~]$ screen -ls
There is a screen on:
        855.pts-0.server1      (Attached)
1 Socket in /var/run/screen/S-svenglar.

[svenglar@server1 ~]$ who
svenglar pts/0      Oct 12 18:25        (tsv1.home.local)

[svenglar@server1 ~]$ ps aux | grep svenglar
root       751  0.0  0.0  90172  3272 ?        Ss   18:25   0:00 sshd: svenglar [priv]
svenglar   757  0.0  0.0  90172  1828 ?        S    18:25   0:00 sshd: svenglar@pts/0
svenglar   758  0.0  0.0  10948  1584 pts/0    Ss   18:25   0:00 -bash
svenglar   854  0.0  0.0  21416   920 pts/0    S+   18:29   0:00 screen
svenglar   855  0.0  0.0  26812  6344 ?        Ss   18:29   0:00 SCREEN
svenglar   856  0.0  0.0  11080  1596 pts/1    Ss   18:29   0:00 /bin/bash
svenglar   988  0.0  0.0  10476   896 pts/1    R+   18:31   0:00 ps aux
svenglar   989  0.0  0.0   6052   576 pts/1    S+   18:31   0:00 grep svenglar

[svenglar@server1 ~]$ ps uxf
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
svenglar   757  0.0  0.0  90172  1828 ?        S    18:25   0:00 sshd: svenglar@pts/0
svenglar   758  0.0  0.0  10948  1584 pts/0    Ss   18:25   0:00  \_ -bash
svenglar   854  0.0  0.0  21416   920 pts/0    S+   18:29   0:00      \_ screen
svenglar   855  0.0  0.0  26812  6348 ?        Ss   18:29   0:00          \_ SCREEN
svenglar   856  0.0  0.0  11080  1600 pts/1    Ss   18:29   0:00              \_ /bin/bash
svenglar   990  0.0  0.0  10472   852 pts/1    R+   18:31   0:00                  \_ ps uxf

[svenglar@server1 ~]$

.

[svenglar@server2 ~]$ who
svenglar pts/0      Oct 12 18:33    (tsv1.home.local)

[svenglar@server2 ~]$ screen -ls
No Sockets found in /var/run/screen/S-svenglar.

[svenglar@server2 ~]$ ps aux | grep svenglar
root       751  0.0  0.0  90172  3272 ?       Ss   18:25   0:00 sshd: svenglar [priv]
svenglar   757  0.0  0.0  90172  1828 ?       S    18:25   0:00 sshd: svenglar@pts/0
svenglar   758  0.0  0.0  10948  1584 pts/0   Ss   18:25   0:00 -bash
svenglar   822  0.0  0.0  10476   892 pts/0   R+   18:27   0:00 ps aux
svenglar   823  0.0  0.0   6052   576 pts/0   S+   18:27   0:00 grep svenglar

[svenglar@server2 ~]$ ps uxf
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
svenglar   757  0.0  0.0  90172  1828 ?        S    18:25   0:00 sshd: svenglar@pts/0
svenglar   758  0.0  0.0  10948  1584 pts/0    Ss   18:25   0:00  \_ -bash
svenglar   829  0.0  0.0  10472   848 pts/0    R+   18:27   0:00      \_ ps uxf

[svenglar@server2 ~]$ screen

[svenglar@server2 ~]$ screen -ls
There is a screen on:
        6052.pts-0.server2      (Attached)
1 Socket in /var/run/screen/S-svenglar.

[svenglar@server2 ~]$ who
svenglar pts/0      Oct 12 18:33    (tsv1.home.local)
svenglar pts/1      Oct 12 18:35    (:pts/1:S.0)

[svenglar@server2 ~]$ ps aux | grep svenglar
root       751  0.0  0.0  90172  3272 ?        Ss   18:25   0:00 sshd: svenglar [priv]
svenglar   757  0.0  0.0  90172  1828 ?        S    18:25   0:00 sshd: svenglar@pts/0
svenglar   758  0.0  0.0  10948  1584 pts/0    Ss   18:25   0:00 -bash
svenglar   854  0.0  0.0  21416   920 pts/0    S+   18:29   0:00 screen
svenglar   855  0.0  0.0  26812  6344 ?        Ss   18:29   0:00 SCREEN
svenglar   856  0.0  0.0  11080  1596 pts/1    Ss   18:29   0:00 /bin/bash
svenglar   988  0.0  0.0  10476   896 pts/1    R+   18:31   0:00 ps aux
svenglar   989  0.0  0.0   6052   576 pts/1    S+   18:31   0:00 grep svenglar

[svenglar@server2 ~]$ ps uxf
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
svenglar   757  0.0  0.0  90172  1828 ?        S    18:25   0:00 sshd: svenglar@pts/0
svenglar   758  0.0  0.0  10948  1584 pts/0    Ss   18:25   0:00  \_ -bash
svenglar   854  0.0  0.0  21416   920 pts/0    S+   18:29   0:00      \_ screen
svenglar   855  0.0  0.0  26812  6348 ?        Ss   18:29   0:00          \_ SCREEN
svenglar   856  0.0  0.0  11080  1600 pts/1    Ss   18:29   0:00              \_ /bin/bash
svenglar   990  0.0  0.0  10472   852 pts/1    R+   18:31   0:00                  \_ ps uxf

[svenglar@server2 ~]$
share|improve this answer

Normally, each login shell that you open shows up on who's output (this includes the shells opened from screen and the shell from which you ran screen). However, screen has an option to suppress that behaviour for the shells that it creates. On a per-window basis, you can use ^AL (bound to login) to toggle it, or to set it globally, put deflogin off in your .screenrc.

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.