inotify 一問 - Linux

Table of Contents

謝謝!
用 audit 已經可以找出該 pid 做了什麼事。
但是仍有一點問題,麻煩版上的強者幫我解惑。 <(_ _)>


1. 假設我現在有一隻程式叫 /somewhere/temp.sh, 只做兩件事
touch /path/to/test.txt
rm -f /path/to/test.txt

2. 用了 auditctl -w /path/to/ 去 monitor 這個路徑的改變

3. 執行 /somewhere/temp.sh

4. 用 ausearch -i -f /path/to,的確可以觀察到有一個 pid (假設叫4567),執行了
touch 和 rm的動作。


我的問題是,由於4567這個process在執行完畢就釋放掉了。
在沒有額外從script內記錄下自己的pid的情形下,是否有辨法從
「pid = 4567 去推導 /home/somewhere.sh」這樣的故事呢?

非常感謝…!



※ 引述《Nt1 (用功點吧!)》之銘言:
inotify 是 linux 提供的api, 可以監控目錄/檔案的變更。

請問…是否有辨法進一步的監控到,是哪一隻 process 做出這樣的變更嗎?

不知道是真的沒辨法還是小弟沒注意到,help document看了一下沒特別提到

謝謝!

--
http://www.flickr.com/photos/mong0520/collections/

--

All Comments

Ingrid avatarIngrid2013-04-10
inotify不能,要用loggedfs or audit
Doris avatarDoris2013-04-11
你要不要把ausearch出來的東西看仔細一點?
exe=XXXX 就是那個process的檔案啊
Jake avatarJake2013-04-13
謝謝k大,我看過了,結果是 exec=/bin/rm 但我比較想得到的是
Edward Lewis avatarEdward Lewis2013-04-14
「誰」去call了 rm 刪檔,也就是得到 /somewhere/temp.sh
這樣的資訊。謝謝您~
Zora avatarZora2013-04-15
看ppid吧? 找找看audit能不能block systemcall?