Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 11-05-2007, 07:47 AM   #1
Registered: Aug 2007
Posts: 67

Rep: Reputation: 26
what/who started that process

Is there anyway in linux to know who/what started a process - AFTER that process has complete?
Old 11-05-2007, 08:49 AM   #2
Senior Member
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,991

Rep: Reputation: 76
In general, no. Once a process has completed, it is removed from the kernel's process queues.

If the kernel held on to memory about processes after they had run then it would eventually run out of memory, not to mention the fact that you would run out of PID numbers very quickly.

While a process is running you can use the ps and pstree command to give you that kind of information; for more details see
man ps; man pstree
If you are interested in recording that kind of information then you could set up a cron job like this:
crontab -e
then add this line:
* * * * * sh -c "date; ps axo user,pid,ppid,tty,command" >> ~/ps.log
This will run once a second and append to the file ~/ps.log. You can then read it to see information about a particular process, including the PID, parent PID, user it's started by and terminal it's running on. But this will grow very big very fast, so you may want to either truncate the file periodically and/or run it less often at the risk of missing your process if it completes in less than a minute.
Old 11-05-2007, 09:05 AM   #3
Registered: Aug 2007
Posts: 67

Original Poster
Rep: Reputation: 26
thanks, i thought that.

the tip is kewl.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how a father process know which child process send the signal SIGCHLD icoming Programming 10 07-20-2010 08:26 AM
to know how many users are there and killing some of process started remotely manoj111 Fedora 1 04-03-2007 03:16 PM
rsh started process don't generate core dumps llaswell Linux - Software 0 04-10-2006 12:46 PM
monitor processes to be notified when a new process is started? cfh Programming 2 10-03-2005 08:07 PM
If I want, that process has automatically started at system loading or reloading ukrainet Linux - Newbie 2 12-14-2004 10:39 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:19 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration