LinuxQuestions.org
Support LQ: Use code LQCO20 and save 20% on CrossOver Office
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices

Reply
 
LinkBack Search this Thread
Old 12-28-2008, 09:33 PM   #1
kcoriginal
LQ Newbie
 
Registered: Oct 2007
Location: US -First Baltimore, then MD Sticks, then NC then Cali now San Antonio.
Distribution: ubuntu 8.04 and Centos 5.2
Posts: 29
Blog Entries: 4

Rep: Reputation: 15
How to tell what process last wrote to a file? - hosts file being updated by unk


I am trying to get a multi website running behind a dynamic ip with a ddns service.. lots of questions... just asking one at the moment.

What is writing to my server's hosts file to tell it my public (though dynamic, technically... it hasnt changed in a year now...) ip address as if it is one of the server's alternate IPs... I do have the server set as DMZ on my WRT54G. but... either way... I know somehting in the actual Linux (CentOS 5.2) OS is updating the hosts file with the outside IP. How can I track what process last accessed a file?

If you know the answer to my current specific problem, then ... GREAT!
please tell! But... I am looking to learn the troubleshooting technique for future problems..

thx in advance!

kc
 
Old 12-28-2008, 11:53 PM   #2
dquick1
LQ Newbie
 
Registered: Dec 2008
Location: Geelong, Australia
Distribution: Fedora
Posts: 8

Rep: Reputation: 0
Hi KC,

Unless the process you are trying to debug generates a log file or similar, I don't know anyway to find out this information.

Files in linux are identified and managed using 'Inodes'. Inodes are data structures that pretty much everything about a file except the actual data. This includes permissions, and timestamps etc. Unfortunately they do not store details of the process or user of the last file access etc. For information on Inodes go here: http://www.linfo.org/inode.html

The closest command that I am aware of is stat.

Code:
$ stat test
  File: `test'
  Size: 75              Blocks: 16         IO Block: 4096   regular file
Device: fd00h/64768d    Inode: 3008992     Links: 1
Access: (0664/-rw-rw-r--)  Uid: (  500/     dlq)   Gid: (  500/     dlq)
Access: 2008-12-29 16:09:53.000000000 +1100
Modify: 2008-12-29 16:09:28.000000000 +1100
Change: 2008-12-29 16:09:28.000000000 +1100

Damien
 
  


Reply


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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I wrote a software to read PDF file naihe2010 Linux - Software 1 10-14-2008 06:00 AM
Wrote spec file, installed RPM, binary gives relocation error and refers to build dir hollywoodb Red Hat 2 05-19-2007 10:27 AM
no file access timestamps being updated! takahaya Linux - General 4 04-03-2005 06:48 PM
does the /etc/hosts file work same as the M$ hosts file? Lleb_KCir Linux - Software 6 04-03-2004 04:33 PM
Where can I get an updated db.cache file? _TK_ Linux - Networking 6 02-22-2001 11:37 PM


All times are GMT -5. The time now is 11:27 PM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration