Who's on the console

From: Spalding, Steve <SSPALDIN_at_mem-ins.com>
Date: Wed, 08 Apr 1998 10:39:21 -0500

Hello managers!

I run X windows using CDE on my Alpha 2100, and I am wondering how I can
tell if a user is logged onto the console terminal or not. When I do a
ps -ef on the user, the output looks the same as if that person was
logged in back at his desk. This is what the output of ps -ef|grep
sspaldin looks like when sspaldin is logged in on the console:

MissouriEmployers.mem-ins.com> ps -ef|grep sspaldin
sspaldin 109 31953 0.0 09:58:41 ?? 0:00.97
/usr/dt/bin/dtterm -session dtaazFea -ls
sspaldin 9975 31953 0.0 09:58:41 ?? 0:00.04 sh -c
/usr/bin/X11/dxconsole
sspaldin 15322 31953 0.0 09:58:41 ?? 0:00.95
/usr/dt/bin/dtterm -session dtaazuea -ls
sspaldin 18186 31953 0.0 09:58:36 ?? 0:02.66 dtwm
sspaldin 31953 31430 0.0 09:58:26 ?? 0:01.43
/usr/dt/bin/dtsession
sspaldin 32163 31953 0.0 09:58:41 ?? 0:02.05
/usr/dt/bin/dtterm -session dtaazAea -ls
sspaldin 32317 1 0.0 09:58:33 ?? 0:00.24
/usr/dt/bin/ttsession -s
sspaldin 14471 32163 0.0 09:58:43 ttypa 0:00.31 -ksh (ksh)
sspaldin 32010 109 0.0 09:58:44 ttypd 0:00.30 -ksh (ksh)
dec_test 20619 32141 0.0 10:08:42 ttyq1 0:00.03 grep sspaldin
sspaldin 32472 15322 0.0 09:58:44 ttyq2 0:00.29 -ksh (ksh)

This is what it looks like when the same person is logged on at his
desk:

MissouriEmployers.mem-ins.com> ps -ef|grep sspaldin
sspaldin 552 22374 0.0 10:11:20 ?? 0:02.65 dtwm
sspaldin 798 22374 0.0 10:11:24 ?? 0:00.05 sh -c
/usr/bin/X11/dxconsole
sspaldin 20698 22374 0.0 10:11:24 ?? 0:00.99
/usr/dt/bin/dtterm -session dtaaoEAa -ls
sspaldin 20909 22374 0.0 10:11:24 ?? 0:01.01
/usr/dt/bin/dtterm -session dtaaFnda -ls
sspaldin 22374 136 0.0 10:11:12 ?? 0:01.46
/usr/dt/bin/dtsession
sspaldin 25268 1 0.0 10:11:17 ?? 0:00.23
/usr/dt/bin/ttsession -s
sspaldin 31642 22374 0.0 10:11:24 ?? 0:00.97
/usr/dt/bin/dtterm -session dtaaadna -ls
sspaldin 844 20909 0.0 10:11:25 ttypa 0:00.31 -ksh (ksh)
sspaldin 1364 20698 0.0 10:11:25 ttypd 0:00.36 -ksh (ksh)
dec_test 1112 32141 1.3 10:16:36 ttyq1 0:00.04 grep sspaldin
sspaldin 20769 31642 0.0 10:11:26 ttyq2 0:00.27 -ksh (ksh)

I thought that perhaps the /etc/auth/system/ttys file would help out
here, and it does, sort of. There's a line in it that looks like this

\:0|\:0.0:\

:t_devname=\:0:t_uid=sspaldin:t_logtime#892049831:t_unsucuid=dhumisto:\
        :t_unsuctime#891372778:t_login_timeout#0:t_xdisplay:chkent:

which I thought at first meant that it kept track of who was currently
in on the console, but I found out that this line does not really change
until someone else has logged in there.

Does anybody have any suggestions? Thanks as always!

Stephen Spalding
sspaldin_at_mem-ins.com
Missouri Employers Mutual Insurance
Received on Wed Apr 08 1998 - 18:01:47 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:37 NZDT