dcron icon indicating copy to clipboard operation
dcron copied to clipboard

Support inotify to watch crontab directories

Open gagern opened this issue 8 years ago • 0 comments

If compiled with make CPPFLAGS=-DUSE_INOTIFY, then crond will now monitor both crontab directories, and will immediately synchronize any files right after they have been closed or deleted. So far this feature is completely undocumented. I gave it a tiny bit of testing, and it appears to work well enough. I haven't attempted to verify all the error code paths, since for most of the errors I don't even know how to deliberately trigger them.

This change may lead to crontabs being re-read twice, once triggered by inotify and a second time by cron.update. This should be no serious problem, though.

The code is heavily based on the example in the inotify man page. On the other hand, except for choosing different names for variables, there probably isn't much room to do things very different from this, so I'm not sure whether we'd have to add a notice to credit the man page authors in accordance with the man page license. Come to think of it, the dcron code should probably specify what version of the GPL to apply.

gagern avatar Mar 18 '16 01:03 gagern