| Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
02-14-2010, 10:55 PM
|
#1
|
|
Member
Registered: Feb 2009
Distribution: Fedora
Posts: 88
Rep:
|
trace writes to file
Does Linux have a way to trace writes to a file?
For each write, I would like to know the time, date, process id, user, file position, byte count, and the data written.
I could use this with a script to replay the writes to a backup of the original file, and reproduce the file contents as they were at a point in time.
-Ben
|
|
|
|
02-15-2010, 01:51 AM
|
#2
|
|
Guru
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,209
Rep: 
|
It is not clear what you mean by "write". Its meaning in computer science is a bit general for your use. Can you be specific about what you want to do? Right now it looks like you are trying to write spyware.
Perhaps you want a simple output to get recorded to a log, along with details about what it is. May be useful in debugging. An example would be the syslog. This immediately suggests logger(1).
Generally you'd have to write the script to produce the log file you needed.
|
|
|
|
02-15-2010, 11:20 PM
|
#3
|
|
Member
Registered: Feb 2009
Distribution: Fedora
Posts: 88
Original Poster
Rep:
|
I mean the write() system call. I am not considering memory mapped I/O. The write() system call is logged by the strace command, but that is per process. I want to find something that is per inode.
Just as an example, I may have an mbox file that could be written to directly from any number of processes including Thunderbird, mutt, and imapd. I would like to be able to tell what was written by Thunderbird, and what was written by mutt.
How would I write a script to do this? I assure you that I am only going to use this on my own computer.
Thank you,
-Ben
|
|
|
|
11-28-2010, 09:46 AM
|
#4
|
|
Member
Registered: Feb 2009
Distribution: Fedora
Posts: 88
Original Poster
Rep:
|
In BSD this would be done with systrace. In SELinux it can be done with an auditallow policy. This thread solved by SELinux.
|
|
|
|
12-05-2010, 11:30 AM
|
#5
|
|
Member
Registered: Feb 2009
Distribution: Fedora
Posts: 88
Original Poster
Rep:
|
p.s.
There is also auditd(1)
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 01:39 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|