4 ms·
I've seen about a dozen versions of this now. So my question is, who watches the watchmen?
by VyseofArcadia 4y ago
I've seen about a dozen versions of this now. So my question is, who watches the watchmen?
- koolba 4y agoIf it’s running in a shell, it’d be the terminal session’s shell. If it’s running as a daemon, in a traditional Unix environment, it’d be the init process (pid 0).
- Brian_K_White 4y agoInotify is a kernel feature. Neither init or a shell or any other userspace code. The userspace code like in inotifywait or incron just tells the kernel what it wants the kernel to watch, and then exits, gone, no further parent, not even init. Ok now that I mentioned incron..., incron being a daemon is managed by init, but incron is not watching any files, not even it's own config files. incron just reads it's incrontab files and registers the desired events with the kernel, and then performs the desired actions when the kernel triggers it. It notices when it's own config files change the same way as any other inotify job, it asks the kernel to tell it when they change. incron is like cron where you write a crontab-like file that specifies a command of your choosing. Pretty much the same as this thing minus some colorful display. I guess the point of this thing would be if it provides a consistent wrapper interface over the various fs watching mechanisms on different OS's. But for linux, I've already been using incron to do this job efficiently for ages.
- cjcampbell 4y agoCame here for this. Thank you.