Posts Topics Forums Images
Search videos from message boards Videos Search messages from microblogs Microblogs Search messages from imdb.com Imdb Search messages from yuku.com Yuku Search messages from lefora.com (free forums) Lefora
My account: Login | Sign Up
Loading... 

Thread: What's touching this file?

Started 3 months, 1 week ago by minnmass
At some point in the past, I started a process which (a) survives reboots, (b) touches the file ~/1, and (c) has no adverse effects of which I am aware. I do not, however, have any idea what is touching ~/1 any longer, and it's starting to annoy me, much like a single mosquito in the room. Neither my account's crontab nor root's has any obvious redirects to this file, nor anything that would ...
Site: Ars OpenForum 3.0b  Ars OpenForum 3.0b - site profile
Forum: Linux Kung Fu  Linux Kung Fu - forum profile
Total authors: 8 authors
Total thread posts: 12 posts
Thread activity: no new posts during last week
Domain info for: arstechnica.com

Other posts in this thread:

Biff replied 3 months, 1 week ago
I'm guessing lsof isn't showing anything holding onto the file?

minnmass replied 3 months, 1 week ago
lsof | grep '/1' doesn't show any processes holding it open, and the file is empty, per 'file'. That would be far too easy, after all.

norton_I replied 3 months, 1 week ago
First thing I would do is: find /etc -type f -print0 | xargs -0 grep /home/me/1 and a couple variants. See if that file is mentioned anywhere in your startup scripts or configuration files. Then install inotify-tools and use inotifywatch to see what does it.

The Shadow replied 3 months, 1 week ago
Show it a doll, and ask it to use the doll to show you.

minnmass replied 3 months, 1 week ago
quote: Originally posted by norton_I: First thing I would do is: find /etc -type f -print0 | xargs -0 grep /home/me/1 and a couple variants. See if that file is mentioned anywhere in your startup scripts or configuration files. I ran that with no results. I'm running it on a slightly larger search space, but results will take a while. quote: Then install inotify-tools and use ...

norton_I replied 3 months, 1 week ago
Hmm... I thought inotifywatch had a way to record PIDs of the offending process, but I guess not. Your plan looks good, though if the file is just being touched, it may be too fast to see. The other thing that comes to mind is to create a tarpit by symlinking /home/me/1 to something that will block. You could use a broken network mount, I can't think of anything less hacktastic

bombcar replied 3 months, 1 week ago
It's in your home directory, so it's probably one of your processes, not root's. It's called 1 so it's probably a typo in a bash script somewhere - something like "- 1" instead of "-1" or something.

euzeka replied 3 months, 1 week ago
quote: Originally posted by bombcar: It's called 1 so it's probably a typo in a bash script somewhere - something like "- 1" instead of "-1" or something. Quite likely. I get '1' files every now and then from mistyped stdout redirects or using syntax for the wrong type of shell. Might be worth looking into (eg. it could be a cron job after all).

Otterz replied 3 months ago
It should work to add that file to the list of files for auditd, and then look at the audit log. It's been forever since I messed with auditd, so I don't remember the syntax.

minnmass replied 3 months ago
Sorry for the long delay in updating (over 24 hours!? Outrageous!). I'm giving auditd a chance; inotify fired off once or twice, but the output from ps aux was ... inconclusive. Thanks!

 

Top contributing authors

Name
Posts
minnmass
4
user's latest post:
What's touching this file?
Published (2009-09-14 20:22:00)
Sorry for the long delay in updating (over 24 hours!? Outrageous!). I'm giving auditd a chance; inotify fired off once or twice, but the output from ps aux was ... inconclusive. Thanks!
norton_I
2
user's latest post:
What's touching this file?
Published (2009-09-10 15:31:00)
Hmm... I thought inotifywatch had a way to record PIDs of the offending process, but I guess not. Your plan looks good, though if the file is just being touched, it may be too fast to see. The other thing that comes to mind is to create a tarpit by symlinking /home/me/1 to something that will block. You could use a broken network mount, I can't think of anything less hacktastic
M. Jones
1
user's latest post:
What's touching this file?
Published (2009-09-14 21:18:00)
quote: Originally posted by euzeka: Quite likely. I get '1' files every now and then from mistyped stdout redirects or using syntax for the wrong type of shell. Might be worth looking into (eg. it could be a cron job after all). This. The likely syntax should look like this: job > /dev/null 2>&1 But you would have an output file "1", that could be size zero depending on output, if you used this incorrect...
Biff
1
user's latest post:
What's touching this file?
Published (2009-09-10 13:44:00)
I'm guessing lsof isn't showing anything holding onto the file?
The Shadow
1
user's latest post:
What's touching this file?
Published (2009-09-10 14:04:00)
Show it a doll, and ask it to use the doll to show you.
bombcar
1
user's latest post:
What's touching this file?
Published (2009-09-11 01:12:00)
It's in your home directory, so it's probably one of your processes, not root's. It's called 1 so it's probably a typo in a bash script somewhere - something like "- 1" instead of "-1" or something.
euzeka
1
user's latest post:
What's touching this file?
Published (2009-09-11 22:17:00)
quote: Originally posted by bombcar: It's called 1 so it's probably a typo in a bash script somewhere - something like "- 1" instead of "-1" or something. Quite likely. I get '1' files every now and then from mistyped stdout redirects or using syntax for the wrong type of shell. Might be worth looking into (eg. it could be a cron job after all).
Otterz
1
user's latest post:
What's touching this file?
Published (2009-09-13 15:08:00)
It should work to add that file to the list of files for auditd, and then look at the audit log. It's been forever since I messed with auditd, so I don't remember the syntax.

Related threads on "Ars OpenForum 3.0b":

Related threads on other sites:

Thread profile page for "What's touching this file?" on http://www.arstechnica.com. This report page is a snippet summary view from a single thread "What's touching this file?", located on the Message Board at http://www.arstechnica.com. This thread profile page shows the thread statistics for: Total Authors, Total Thread Posts, and Thread Activity