Seeing if root is on the console

From: Spalding, Steve <SSPALDIN_at_mem-ins.com>
Date: Tue, 21 Apr 1998 14:19:10 -0500

Hi managers!

I put a message up on the list a while back regarding seeing who is
logged onto the console which is running Xwindows, and the answer was to
use the who command. Well, I've got a twist on this one...we want
certain things in root's .profile to be executed when root logs in on
the console terminal (which still runs Xwindows) but not when we su to
root. When we su to root, we still want .profile to run as there is
still other stuff in that file that needs to be executed for root when
it's logged in.

When we log in as root on the console, we have at least two dtterm
sessions come up, and unfortunately, the parent id on these processes
isn't the same as the owner process id that shows up owning the console
port (I find this using the who -u command). Also, there is a
corresponding process which is running ksh for each of the dtterm
processes and there is no correlation between those processes and any of
the other root processes.

I have tried working with the last command where I set up a set of lines
in .profile to execute when root logs in. Those lines check the
date/time stamp on the process that shows as logged in on the console
against the process that is currently running root's .profile. This idea
works, but it has holes in it. I'm wondering if there is an easier way
of doing this than what I am attempting to do.

Thanks!


Stephen Spalding
Associate System Administrator
Missouri Employers Mutual Insurance
sspaldin_at_mem-ins.com
1000 West Nifong
Columbia, MO 65203
(573) 499-4230
(800) 442-0590
fax (573) 499 - 4310
Received on Tue Apr 21 1998 - 21:22:47 NZST

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