w command doesn't show all pseudo-terminal sessions

Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
If I open terminal and execute w command then it will show:
user tty7 :0 12:04 39:56 36.87s 0.06s /sbin/upstart -
Now if open terminator or xterm and execute w command then it will show it's entry in the output of w command like
user tty7 :0 12:04 39:56 36.87s 0.06s
/sbin/upstart -
user pts/2 :0.0 12:50 1.00s 0.02s 0.00s w
but it will not show a new entry when I open gnome-terminal or xfce4-terminal.
Why it is showing new session for terminator and not for xfce4-terminal?
login session xfce4-terminal w pts
add a comment |Â
up vote
0
down vote
favorite
If I open terminal and execute w command then it will show:
user tty7 :0 12:04 39:56 36.87s 0.06s /sbin/upstart -
Now if open terminator or xterm and execute w command then it will show it's entry in the output of w command like
user tty7 :0 12:04 39:56 36.87s 0.06s
/sbin/upstart -
user pts/2 :0.0 12:50 1.00s 0.02s 0.00s w
but it will not show a new entry when I open gnome-terminal or xfce4-terminal.
Why it is showing new session for terminator and not for xfce4-terminal?
login session xfce4-terminal w pts
Are those terminals running your shell as an interactive login shell or just like an interactive shell (see if$-contains anlin the shell).
â Kusalananda
May 4 at 7:28
what is$-. I am getting errorhimBH command not foundand forecho $-it says himBH
â Debian_yadav
May 4 at 7:51
Related: unix.stackexchange.com/questions/92784/â¦
â Kusalananda
May 4 at 8:13
I read it earlier but didn't get it.
â Debian_yadav
May 4 at 8:16
1
Interesting question that attracted two excellent answers. I've edited the title so that others may find this more easily.
â Anthony Geoghegan
Jul 6 at 10:17
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
If I open terminal and execute w command then it will show:
user tty7 :0 12:04 39:56 36.87s 0.06s /sbin/upstart -
Now if open terminator or xterm and execute w command then it will show it's entry in the output of w command like
user tty7 :0 12:04 39:56 36.87s 0.06s
/sbin/upstart -
user pts/2 :0.0 12:50 1.00s 0.02s 0.00s w
but it will not show a new entry when I open gnome-terminal or xfce4-terminal.
Why it is showing new session for terminator and not for xfce4-terminal?
login session xfce4-terminal w pts
If I open terminal and execute w command then it will show:
user tty7 :0 12:04 39:56 36.87s 0.06s /sbin/upstart -
Now if open terminator or xterm and execute w command then it will show it's entry in the output of w command like
user tty7 :0 12:04 39:56 36.87s 0.06s
/sbin/upstart -
user pts/2 :0.0 12:50 1.00s 0.02s 0.00s w
but it will not show a new entry when I open gnome-terminal or xfce4-terminal.
Why it is showing new session for terminator and not for xfce4-terminal?
login session xfce4-terminal w pts
edited Jul 6 at 10:15
Anthony Geoghegan
7,16633651
7,16633651
asked May 4 at 7:25
Debian_yadav
8342522
8342522
Are those terminals running your shell as an interactive login shell or just like an interactive shell (see if$-contains anlin the shell).
â Kusalananda
May 4 at 7:28
what is$-. I am getting errorhimBH command not foundand forecho $-it says himBH
â Debian_yadav
May 4 at 7:51
Related: unix.stackexchange.com/questions/92784/â¦
â Kusalananda
May 4 at 8:13
I read it earlier but didn't get it.
â Debian_yadav
May 4 at 8:16
1
Interesting question that attracted two excellent answers. I've edited the title so that others may find this more easily.
â Anthony Geoghegan
Jul 6 at 10:17
add a comment |Â
Are those terminals running your shell as an interactive login shell or just like an interactive shell (see if$-contains anlin the shell).
â Kusalananda
May 4 at 7:28
what is$-. I am getting errorhimBH command not foundand forecho $-it says himBH
â Debian_yadav
May 4 at 7:51
Related: unix.stackexchange.com/questions/92784/â¦
â Kusalananda
May 4 at 8:13
I read it earlier but didn't get it.
â Debian_yadav
May 4 at 8:16
1
Interesting question that attracted two excellent answers. I've edited the title so that others may find this more easily.
â Anthony Geoghegan
Jul 6 at 10:17
Are those terminals running your shell as an interactive login shell or just like an interactive shell (see if
$- contains an l in the shell).â Kusalananda
May 4 at 7:28
Are those terminals running your shell as an interactive login shell or just like an interactive shell (see if
$- contains an l in the shell).â Kusalananda
May 4 at 7:28
what is
$- . I am getting error himBH command not found and for echo $- it says himBHâ Debian_yadav
May 4 at 7:51
what is
$- . I am getting error himBH command not found and for echo $- it says himBHâ Debian_yadav
May 4 at 7:51
Related: unix.stackexchange.com/questions/92784/â¦
â Kusalananda
May 4 at 8:13
Related: unix.stackexchange.com/questions/92784/â¦
â Kusalananda
May 4 at 8:13
I read it earlier but didn't get it.
â Debian_yadav
May 4 at 8:16
I read it earlier but didn't get it.
â Debian_yadav
May 4 at 8:16
1
1
Interesting question that attracted two excellent answers. I've edited the title so that others may find this more easily.
â Anthony Geoghegan
Jul 6 at 10:17
Interesting question that attracted two excellent answers. I've edited the title so that others may find this more easily.
â Anthony Geoghegan
Jul 6 at 10:17
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
4
down vote
accepted
w displays the information stored in utmp (/var/run/utmp typically on Linux systems). This generally is only updated by âÂÂloginâ sessions, i.e. login (for logins on virtual consoles or serial connections), the display manager (for graphical sessions), the SSH server (for SSH connections), and some (most?) terminal emulators. In the latter case, whether or not they update utmp depends on their built-in support and configuration; for example xterm has the ut flag for this (-ut disables utmp updates, +ut enables them), and GNOME Terminal no longer updates utmp directly at all.
So youâÂÂre seeing the entries which have been added to utmp in your case: one added by your display manager (on tty7), and others added by some of the terminal emulators youâÂÂre using.
It should be possible to wrap commands to add utmp logging to anything you like, using for example libutempter, but that is apparently not as straightforward as one might hope.
Is it possible to change the configuration ofgnome-terminal
â Debian_yadav
May 4 at 13:39
add a comment |Â
up vote
2
down vote
w does not show terminal sessions. The login database, that the w program reports on, is not a terminal database. (Formally, it is a user accounting database, but the Single Unix Specification is incomplete on this point.)
If it were a terminal database, it would record all of the pseudo terminals that programs use, from the likes of NeoVIM, emacs, tmux, screen, ptybandage, ptyrun, and even script. But it does not, and it is not.
(One can make a similar argument, that needs a slightly greater knowledge of history, about it not recording "call out" terminal usage and the likes of BBS, FidoNet, and UUCP terminal sessions.)
As a login database, it records login sessions, both textual and graphical. The libvte people make the argument that writing to this database is within the purview of the login subsystems, graphical and textual, not within the purview of a terminal emulator that runs within login sessions. This is a fair point, bolstered by the fact that it makes a nonsense of the security of login accounting to allow programs outwith the Trusted Computing Base to write/update the login database.
As such, you shouldn't expect every terminal emulator session to show up as a login session in the login database â or indeed any terminal emulator sessions. Even terminal emulators that are invoking login shells are not doing any actual logging on to the system, and are acting entirely within an already-logged-in session. Terminal emulator writers tried to make the login database record terminal emulator sessions, but the effort has led to a number of problems, long-since recognized.
Conversely, you should expect to see a single record for your GUI login session. (Although, as explained in an article in further reading, in practice this is rather a mess.)
Further reading
- Jonathan de Boyne Pollard (2018). The Unix login database. Frequently Given Answers.
- https://unix.stackexchange.com/a/437762/5132
pututxline. Base Specifications. IEEE 1003.1:2017. The Open Group.
Thanks for the informative answer. However, I don't really understand this part: "it makes a nonsense of the security of login accounting to allow programs outwith the Trusted Computing Base to write/update the login database."
â Anthony Geoghegan
Jul 6 at 10:28
It just occurred to me that outwith may have been intended as outwit. Maybe, undermine might be a better word - but I'm not particularly familiar with the concept of Trusted Computing Base.
â Anthony Geoghegan
Jul 6 at 13:55
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
accepted
w displays the information stored in utmp (/var/run/utmp typically on Linux systems). This generally is only updated by âÂÂloginâ sessions, i.e. login (for logins on virtual consoles or serial connections), the display manager (for graphical sessions), the SSH server (for SSH connections), and some (most?) terminal emulators. In the latter case, whether or not they update utmp depends on their built-in support and configuration; for example xterm has the ut flag for this (-ut disables utmp updates, +ut enables them), and GNOME Terminal no longer updates utmp directly at all.
So youâÂÂre seeing the entries which have been added to utmp in your case: one added by your display manager (on tty7), and others added by some of the terminal emulators youâÂÂre using.
It should be possible to wrap commands to add utmp logging to anything you like, using for example libutempter, but that is apparently not as straightforward as one might hope.
Is it possible to change the configuration ofgnome-terminal
â Debian_yadav
May 4 at 13:39
add a comment |Â
up vote
4
down vote
accepted
w displays the information stored in utmp (/var/run/utmp typically on Linux systems). This generally is only updated by âÂÂloginâ sessions, i.e. login (for logins on virtual consoles or serial connections), the display manager (for graphical sessions), the SSH server (for SSH connections), and some (most?) terminal emulators. In the latter case, whether or not they update utmp depends on their built-in support and configuration; for example xterm has the ut flag for this (-ut disables utmp updates, +ut enables them), and GNOME Terminal no longer updates utmp directly at all.
So youâÂÂre seeing the entries which have been added to utmp in your case: one added by your display manager (on tty7), and others added by some of the terminal emulators youâÂÂre using.
It should be possible to wrap commands to add utmp logging to anything you like, using for example libutempter, but that is apparently not as straightforward as one might hope.
Is it possible to change the configuration ofgnome-terminal
â Debian_yadav
May 4 at 13:39
add a comment |Â
up vote
4
down vote
accepted
up vote
4
down vote
accepted
w displays the information stored in utmp (/var/run/utmp typically on Linux systems). This generally is only updated by âÂÂloginâ sessions, i.e. login (for logins on virtual consoles or serial connections), the display manager (for graphical sessions), the SSH server (for SSH connections), and some (most?) terminal emulators. In the latter case, whether or not they update utmp depends on their built-in support and configuration; for example xterm has the ut flag for this (-ut disables utmp updates, +ut enables them), and GNOME Terminal no longer updates utmp directly at all.
So youâÂÂre seeing the entries which have been added to utmp in your case: one added by your display manager (on tty7), and others added by some of the terminal emulators youâÂÂre using.
It should be possible to wrap commands to add utmp logging to anything you like, using for example libutempter, but that is apparently not as straightforward as one might hope.
w displays the information stored in utmp (/var/run/utmp typically on Linux systems). This generally is only updated by âÂÂloginâ sessions, i.e. login (for logins on virtual consoles or serial connections), the display manager (for graphical sessions), the SSH server (for SSH connections), and some (most?) terminal emulators. In the latter case, whether or not they update utmp depends on their built-in support and configuration; for example xterm has the ut flag for this (-ut disables utmp updates, +ut enables them), and GNOME Terminal no longer updates utmp directly at all.
So youâÂÂre seeing the entries which have been added to utmp in your case: one added by your display manager (on tty7), and others added by some of the terminal emulators youâÂÂre using.
It should be possible to wrap commands to add utmp logging to anything you like, using for example libutempter, but that is apparently not as straightforward as one might hope.
edited May 4 at 13:55
answered May 4 at 12:29
Stephen Kitt
140k22302363
140k22302363
Is it possible to change the configuration ofgnome-terminal
â Debian_yadav
May 4 at 13:39
add a comment |Â
Is it possible to change the configuration ofgnome-terminal
â Debian_yadav
May 4 at 13:39
Is it possible to change the configuration of
gnome-terminalâ Debian_yadav
May 4 at 13:39
Is it possible to change the configuration of
gnome-terminalâ Debian_yadav
May 4 at 13:39
add a comment |Â
up vote
2
down vote
w does not show terminal sessions. The login database, that the w program reports on, is not a terminal database. (Formally, it is a user accounting database, but the Single Unix Specification is incomplete on this point.)
If it were a terminal database, it would record all of the pseudo terminals that programs use, from the likes of NeoVIM, emacs, tmux, screen, ptybandage, ptyrun, and even script. But it does not, and it is not.
(One can make a similar argument, that needs a slightly greater knowledge of history, about it not recording "call out" terminal usage and the likes of BBS, FidoNet, and UUCP terminal sessions.)
As a login database, it records login sessions, both textual and graphical. The libvte people make the argument that writing to this database is within the purview of the login subsystems, graphical and textual, not within the purview of a terminal emulator that runs within login sessions. This is a fair point, bolstered by the fact that it makes a nonsense of the security of login accounting to allow programs outwith the Trusted Computing Base to write/update the login database.
As such, you shouldn't expect every terminal emulator session to show up as a login session in the login database â or indeed any terminal emulator sessions. Even terminal emulators that are invoking login shells are not doing any actual logging on to the system, and are acting entirely within an already-logged-in session. Terminal emulator writers tried to make the login database record terminal emulator sessions, but the effort has led to a number of problems, long-since recognized.
Conversely, you should expect to see a single record for your GUI login session. (Although, as explained in an article in further reading, in practice this is rather a mess.)
Further reading
- Jonathan de Boyne Pollard (2018). The Unix login database. Frequently Given Answers.
- https://unix.stackexchange.com/a/437762/5132
pututxline. Base Specifications. IEEE 1003.1:2017. The Open Group.
Thanks for the informative answer. However, I don't really understand this part: "it makes a nonsense of the security of login accounting to allow programs outwith the Trusted Computing Base to write/update the login database."
â Anthony Geoghegan
Jul 6 at 10:28
It just occurred to me that outwith may have been intended as outwit. Maybe, undermine might be a better word - but I'm not particularly familiar with the concept of Trusted Computing Base.
â Anthony Geoghegan
Jul 6 at 13:55
add a comment |Â
up vote
2
down vote
w does not show terminal sessions. The login database, that the w program reports on, is not a terminal database. (Formally, it is a user accounting database, but the Single Unix Specification is incomplete on this point.)
If it were a terminal database, it would record all of the pseudo terminals that programs use, from the likes of NeoVIM, emacs, tmux, screen, ptybandage, ptyrun, and even script. But it does not, and it is not.
(One can make a similar argument, that needs a slightly greater knowledge of history, about it not recording "call out" terminal usage and the likes of BBS, FidoNet, and UUCP terminal sessions.)
As a login database, it records login sessions, both textual and graphical. The libvte people make the argument that writing to this database is within the purview of the login subsystems, graphical and textual, not within the purview of a terminal emulator that runs within login sessions. This is a fair point, bolstered by the fact that it makes a nonsense of the security of login accounting to allow programs outwith the Trusted Computing Base to write/update the login database.
As such, you shouldn't expect every terminal emulator session to show up as a login session in the login database â or indeed any terminal emulator sessions. Even terminal emulators that are invoking login shells are not doing any actual logging on to the system, and are acting entirely within an already-logged-in session. Terminal emulator writers tried to make the login database record terminal emulator sessions, but the effort has led to a number of problems, long-since recognized.
Conversely, you should expect to see a single record for your GUI login session. (Although, as explained in an article in further reading, in practice this is rather a mess.)
Further reading
- Jonathan de Boyne Pollard (2018). The Unix login database. Frequently Given Answers.
- https://unix.stackexchange.com/a/437762/5132
pututxline. Base Specifications. IEEE 1003.1:2017. The Open Group.
Thanks for the informative answer. However, I don't really understand this part: "it makes a nonsense of the security of login accounting to allow programs outwith the Trusted Computing Base to write/update the login database."
â Anthony Geoghegan
Jul 6 at 10:28
It just occurred to me that outwith may have been intended as outwit. Maybe, undermine might be a better word - but I'm not particularly familiar with the concept of Trusted Computing Base.
â Anthony Geoghegan
Jul 6 at 13:55
add a comment |Â
up vote
2
down vote
up vote
2
down vote
w does not show terminal sessions. The login database, that the w program reports on, is not a terminal database. (Formally, it is a user accounting database, but the Single Unix Specification is incomplete on this point.)
If it were a terminal database, it would record all of the pseudo terminals that programs use, from the likes of NeoVIM, emacs, tmux, screen, ptybandage, ptyrun, and even script. But it does not, and it is not.
(One can make a similar argument, that needs a slightly greater knowledge of history, about it not recording "call out" terminal usage and the likes of BBS, FidoNet, and UUCP terminal sessions.)
As a login database, it records login sessions, both textual and graphical. The libvte people make the argument that writing to this database is within the purview of the login subsystems, graphical and textual, not within the purview of a terminal emulator that runs within login sessions. This is a fair point, bolstered by the fact that it makes a nonsense of the security of login accounting to allow programs outwith the Trusted Computing Base to write/update the login database.
As such, you shouldn't expect every terminal emulator session to show up as a login session in the login database â or indeed any terminal emulator sessions. Even terminal emulators that are invoking login shells are not doing any actual logging on to the system, and are acting entirely within an already-logged-in session. Terminal emulator writers tried to make the login database record terminal emulator sessions, but the effort has led to a number of problems, long-since recognized.
Conversely, you should expect to see a single record for your GUI login session. (Although, as explained in an article in further reading, in practice this is rather a mess.)
Further reading
- Jonathan de Boyne Pollard (2018). The Unix login database. Frequently Given Answers.
- https://unix.stackexchange.com/a/437762/5132
pututxline. Base Specifications. IEEE 1003.1:2017. The Open Group.
w does not show terminal sessions. The login database, that the w program reports on, is not a terminal database. (Formally, it is a user accounting database, but the Single Unix Specification is incomplete on this point.)
If it were a terminal database, it would record all of the pseudo terminals that programs use, from the likes of NeoVIM, emacs, tmux, screen, ptybandage, ptyrun, and even script. But it does not, and it is not.
(One can make a similar argument, that needs a slightly greater knowledge of history, about it not recording "call out" terminal usage and the likes of BBS, FidoNet, and UUCP terminal sessions.)
As a login database, it records login sessions, both textual and graphical. The libvte people make the argument that writing to this database is within the purview of the login subsystems, graphical and textual, not within the purview of a terminal emulator that runs within login sessions. This is a fair point, bolstered by the fact that it makes a nonsense of the security of login accounting to allow programs outwith the Trusted Computing Base to write/update the login database.
As such, you shouldn't expect every terminal emulator session to show up as a login session in the login database â or indeed any terminal emulator sessions. Even terminal emulators that are invoking login shells are not doing any actual logging on to the system, and are acting entirely within an already-logged-in session. Terminal emulator writers tried to make the login database record terminal emulator sessions, but the effort has led to a number of problems, long-since recognized.
Conversely, you should expect to see a single record for your GUI login session. (Although, as explained in an article in further reading, in practice this is rather a mess.)
Further reading
- Jonathan de Boyne Pollard (2018). The Unix login database. Frequently Given Answers.
- https://unix.stackexchange.com/a/437762/5132
pututxline. Base Specifications. IEEE 1003.1:2017. The Open Group.
answered May 4 at 16:26
JdeBP
28.1k459133
28.1k459133
Thanks for the informative answer. However, I don't really understand this part: "it makes a nonsense of the security of login accounting to allow programs outwith the Trusted Computing Base to write/update the login database."
â Anthony Geoghegan
Jul 6 at 10:28
It just occurred to me that outwith may have been intended as outwit. Maybe, undermine might be a better word - but I'm not particularly familiar with the concept of Trusted Computing Base.
â Anthony Geoghegan
Jul 6 at 13:55
add a comment |Â
Thanks for the informative answer. However, I don't really understand this part: "it makes a nonsense of the security of login accounting to allow programs outwith the Trusted Computing Base to write/update the login database."
â Anthony Geoghegan
Jul 6 at 10:28
It just occurred to me that outwith may have been intended as outwit. Maybe, undermine might be a better word - but I'm not particularly familiar with the concept of Trusted Computing Base.
â Anthony Geoghegan
Jul 6 at 13:55
Thanks for the informative answer. However, I don't really understand this part: "it makes a nonsense of the security of login accounting to allow programs outwith the Trusted Computing Base to write/update the login database."
â Anthony Geoghegan
Jul 6 at 10:28
Thanks for the informative answer. However, I don't really understand this part: "it makes a nonsense of the security of login accounting to allow programs outwith the Trusted Computing Base to write/update the login database."
â Anthony Geoghegan
Jul 6 at 10:28
It just occurred to me that outwith may have been intended as outwit. Maybe, undermine might be a better word - but I'm not particularly familiar with the concept of Trusted Computing Base.
â Anthony Geoghegan
Jul 6 at 13:55
It just occurred to me that outwith may have been intended as outwit. Maybe, undermine might be a better word - but I'm not particularly familiar with the concept of Trusted Computing Base.
â Anthony Geoghegan
Jul 6 at 13:55
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f441717%2fw-command-doesnt-show-all-pseudo-terminal-sessions%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Are those terminals running your shell as an interactive login shell or just like an interactive shell (see if
$-contains anlin the shell).â Kusalananda
May 4 at 7:28
what is
$-. I am getting errorhimBH command not foundand forecho $-it says himBHâ Debian_yadav
May 4 at 7:51
Related: unix.stackexchange.com/questions/92784/â¦
â Kusalananda
May 4 at 8:13
I read it earlier but didn't get it.
â Debian_yadav
May 4 at 8:16
1
Interesting question that attracted two excellent answers. I've edited the title so that others may find this more easily.
â Anthony Geoghegan
Jul 6 at 10:17