LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-24-2011, 11:25 PM   #1
tinko
LQ Newbie
 
Registered: Nov 2010
Distribution: LFS
Posts: 7

Rep: Reputation: 0
log all run programs


Hello, I want to log all binaries, that are run on my system, no matter wether they are manually run, run by a script or run by another binary.

Is this possible?
 
Old 04-24-2011, 11:35 PM   #2
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Hello,

I have come across this - http://superuser.com/questions/88403...when-on-ubuntu

Is that something you are looking for?

Cheers,

Josh
 
1 members found this post helpful.
Old 04-25-2011, 12:24 AM   #3
tinko
LQ Newbie
 
Registered: Nov 2010
Distribution: LFS
Posts: 7

Original Poster
Rep: Reputation: 0
Thanks for answering.
Unfortunately this is only about logging the programs that are manually started. However I am interested in all started programs, no matter by whom.

One idea that came up to me, was logging the results of ps -A. However if this is done only in a certain interval I would either miss a lot of small processes or get a damn big load of log-files with very few differences. My bash knowledge is extremely limited, is their a trivial solution to store only the lines of the ps -A output that haven't come up in the log so far? I notice several big "jumps", especially early, in the IDs in my ps -A output. Are those gaps reserved by some programs that could be run later or can I rely on new processes to always show up at the end of the output?
Is there a more elegant solution than using ps -A? The aim is still to log every process started, if it is started often, I want to log it every single time.
 
Old 04-25-2011, 11:58 PM   #4
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 676

Rep: Reputation: 137Reputation: 137
Quote:
Originally Posted by tinko View Post
Thanks for answering.
Unfortunately this is only about logging the programs that are manually started. However I am interested in all started programs, no matter by whom.

One idea that came up to me, was logging the results of ps -A. However if this is done only in a certain interval I would either miss a lot of small processes or get a damn big load of log-files with very few differences. My bash knowledge is extremely limited, is their a trivial solution to store only the lines of the ps -A output that haven't come up in the log so far? I notice several big "jumps", especially early, in the IDs in my ps -A output. Are those gaps reserved by some programs that could be run later or can I rely on new processes to always show up at the end of the output?
Is there a more elegant solution than using ps -A? The aim is still to log every process started, if it is started often, I want to log it every single time.
You can write your own library, that has execve function with logging and then put name of this library into /etc/ld.preload file
This way (almost) any program will be executed with yours execve instead of system one.

Be sure to test your libraries well (with LD_PRELOAD) before adding it to /etc/ld.preload
Once your library name is here you will have a difficult time to get rid of it, if your library is buggy.

But why you want such a thing in the first place?
 
1 members found this post helpful.
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can SQUID log skype calls,voip,chat programs in access.log revinking Linux - Newbie 6 07-27-2008 01:14 PM
SA log analyzer programs ddenton Linux - Software 0 01-03-2008 11:33 AM
Any good log analysis programs? alouks Linux - Server 4 08-17-2006 10:25 AM
How to start programs at log in. Geminias Linux - General 5 07-23-2006 06:32 AM
Using the log to monitor the programs used blufire Programming 7 06-18-2005 06:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:21 PM.

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