- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to detect a "touch" (Ignore earlier post with ...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2004 04:18 AM
01-13-2004 04:18 AM
How to detect a "touch" (Ignore earlier post with same title)
I've tried using lsof and fuser. I fire them off in a continuous loop but they never expose the process touching the file. I'm pretty sure that lsof and fuser don't detect "touch" as touch is just changing a directory entry or something to that effect, right?
Any ideas?
Thanks!
Jason
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2004 04:22 AM
01-13-2004 04:22 AM
Re: How to detect a "touch" (Ignore earlier post with same title)
Try changing permission of this file and directory. Then you may get that particular job is failing. This is one of the way you can trace this hidden job.
Good luck
Shahul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2004 04:27 AM
01-13-2004 04:27 AM
Re: How to detect a "touch" (Ignore earlier post with same title)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2004 04:28 AM
01-13-2004 04:28 AM
Re: How to detect a "touch" (Ignore earlier post with same title)
I would tend to loop do ps -e's to a file with a datestamp between each ps and compare those to the file times. You should get lucky at some point.
There is no direct method to know which process last accessed a file. That is simply not carried in the inode.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2004 04:32 AM
01-13-2004 04:32 AM
Re: How to detect a "touch" (Ignore earlier post with same title)
I just tried to turn on auditing via SAM and I get an error msg:
"This system is configured as either an NIS server or an NIS client. Converting a system configured for NIS to a trusted system is not allowed. These two features are not supported together."
So, that doesn't look like an option at the moment. Great suggestion though... and one I would have never thought to try.
Thanks!
Jason
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2004 04:48 AM
01-13-2004 04:48 AM
Re: How to detect a "touch" (Ignore earlier post with same title)
while true
do
ps -aef |grep touch > touch.file.out
cat touch.file.out
sleep 5
done
You can change the sleep time... if it is too short. Then capture the pid
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2004 04:57 AM
01-13-2004 04:57 AM
Re: How to detect a "touch" (Ignore earlier post with same title)
replace the touch command with a script. Rename the touch into touch touch.old and create a script touch with:
date >> /usr/bin/touch.log
ps -ef >> /usr/bin/touch.log
touch.old $*
Then you will see any calling of touch.
greetings,
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2004 05:08 AM
01-13-2004 05:08 AM
Re: How to detect a "touch" (Ignore earlier post with same title)
All 'touch' does is basically to use the system call 'utime' to update the access and modification times. If the process simply touches the file, it will not be captured by fuser or lsof.
I would also follow the same 'ps' and datestamp procedure. If I can find out the processes within that particular instant of time with 'ps', then I would run tusc on these processes (cumbersome ofcourse) and see what process was using utime on this file.
But if the process is actually "opening" the file, then you can get information from fuser or lsof if you use them against the filesystem holding the file. Write a script that does a diff of the previous and current outputs and write it it into the file.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2004 05:15 AM
01-13-2004 05:15 AM
Re: How to detect a "touch" (Ignore earlier post with same title)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2004 06:01 AM
01-13-2004 06:01 AM
Re: How to detect a "touch" (Ignore earlier post with same title)
This is strange...
Jason
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2004 11:58 PM
01-13-2004 11:58 PM
Re: How to detect a "touch" (Ignore earlier post with same title)
Is this a system file, or one in an application or data dir?
Did you have any luck changing the permissions of the file/dir to see if some other app/script logged an error?
regards,
Darren.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2004 12:14 AM
01-14-2004 12:14 AM
Re: How to detect a "touch" (Ignore earlier post with same title)
Alternatively, run top or glance to see if you can see the process.
Also, have a look at jobs that have been running under the same user as the file owner for some time. Could be he has a program that's running in a loop that he has forgotten about?