real owner of a process

From: Roetman, Paul (Paul.Roetman@dpiterminals.com)
Date: Mon Jun 20 2005 - 03:14:41 EDT


Is there any quick/simple/easy way to find out who really started an existing
process - similar to what BSM reports?

For example

        login: jo
        password: ****
        $ su - fred
        password: *****
        $ who am I
        jo pts/1 datetime ipaddress <== reports the original login
        $whoami
        fred <== reports the current login
        $id
        uid=2001(fred) gid=100(staff) <== reports the current login
        $ start_background_proc &

When using BSM, it would report the process start_background_proc as started
by jo.

But when using prstat, top, or ps, lsof -p pid, it reports the process as
fred. I would like a command that reports "jo"

This is Solaris 2.8; and using ksh (but any shell will do!).

The purpose of the exercise to check that certain processes have been started
by the correct login user, so when BSM reports are generated, the correct user
will be running each process! In the above example, a cron script would checks
the process "start_background_proc" user is fred - if not, then send me an
email.

Note: could also do the test in c..

Thanks in advance

Paul

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.7.8/22 - Release Date: 17/06/2005
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers


This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:30:56 EDT