Skip to content

Conversation

@gagern
Copy link

@gagern gagern commented Mar 18, 2016

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 added 2 commits March 18, 2016 01:48
This 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant