# # (SCO Unix) How can I back trace a process to its parents?
APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

SCO Unix, Xenix and ODT General FAQ

I've removed advertising from most of this site and will eventually clean up the few pages where it remains.

While not terribly expensive to maintain, this does cost me something. If I don't get enough donations to cover that expense, I will be shutting the site down in early 2020.

If you found something useful today, please consider a small donation.



Some material is very old and may be incorrect today

© December 2003 (various)

This article is from a FAQ concerning SCO operating systems. While some of the information may be applicable to any OS, or any Unix or Linux OS, it may be specific to SCO Xenix, Open There is lots of Linux, Mac OS X and general Unix info elsewhere on this site: Search this site is the best way to find anything.

How can I tell if a user logged in locally, used rlogin, telnet or ssh?

You can use the concept here to back trace any process. This script will find the first ancestor process after init. This would be sshd or telnet or just a getty, etc.


   MYPROC=$$
   NEXTPROC=$MYPROC
   while [ $NEXTPROC != 1 ]
   do
   MYPROC=$NEXTPROC
   NEXTPROC=`ps -p $MYPROC -o "ppid=" `
   done
   ps -p $MYPROC -o args=
 

Fabio Gianotti observed:

Not to be picky, but on my system, the above script returns "/etc/inetd" if
you've used either telnet or rlogin , so I changed it slightly:

   echo $0 `tty` `id`
   INETPROC=`cat /etc/inetd.pid`
   MYPROC=$$
   NEXTPROC=$MYPROC
   while [ $NEXTPROC != 1 -a $NEXTPROC != $INETPROC ]
   do
   MYPROC=$NEXTPROC
   NEXTPROC=`ps -p $MYPROC -o "ppid=" `
   done
   ps -p $MYPROC -o args=


If you found something useful today, please consider a small donation.



Got something to add? Send me email.





(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

->
-> (SCO Unix) How can I back trace a process to its parents?


Inexpensive and informative Apple related e-books:

Take Control of OS X Server

Take Control of Apple Mail, Third Edition

Take Control of Pages

Take Control of Parallels Desktop 12

iOS 10: A Take Control Crash Course






Printer Friendly Version

Have you tried Searching this site?

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us


Printer Friendly Version





C++ is a badly designed and ugly language. It would be a shame to use it in Emacs. (Richard Stallman)




Linux posts

Troubleshooting posts


This post tagged:

FAQ

SSH



Unix/Linux Consultants

Skills Tests

Unix/Linux Book Reviews

My Unix/Linux Troubleshooting Book

This site runs on Linode