Thanks for the very useful info. I am using one of the SUSE supplied
kotd (kernel of the day) and I noticed that I have CONFIG_INOTIFY=y in
.config. However, there is no /dev/inotify. Also dmesg | grep inotify
does not show anything. How do I know what is the inotify minor
version? Do I still need to apply inotify patches if CONFIG_INOTIFY=y
for 2.6.14 kernel?
thanks,
Osh
On 11/15/05, Steve Graegert
On 11/15/05, Osho GG
wrote: Hi,
I would like to execute a scrit every time the /etc/resolv.conf file is modified. Is there a way to do that?
I am not aware of an effective solution with a script (except copying the file to another place and checking for modifications on a regular basis), but with kernel 2.6 you can utilize /dev/inotify which has been developed for this purpose. IBM provides some example code that compiles out of the box and monitors any directory.
inotify is outlined in here: http://www-128.ibm.com/developerworks/linux/library/l-inotify.html
and code can found right at the botton. You can filter the events (e.g. IN_MODIFY) you are willing to receive.
\Steve
--
Steve Graegert
Software Consultant {C/C++ && Java && .NET} Office: +49 9131 7123988 Mobile: +49 1520 9289212 -- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
-- Osho