[Freeipa-devel] [PATCHES][SSSD] Config monitoring patches
Simo Sorce
ssorce at redhat.com
Tue Jun 30 18:53:43 UTC 2009
On Wed, 2009-06-24 at 08:24 -0400, Stephen Gallagher wrote:
> + /* First, remove the old watch descriptor */
> + ret = inotify_rm_watch(file_ctx->fd, file_ctx->wd);
> + if (ret < 0) {
> + err = errno;
> + DEBUG(0, ("Could not remove watch descriptor [%s]",
> + strerror(err)));
> + }
> +
> + file_ctx->wd = inotify_add_watch(file_ctx->fd,
> file_ctx->filename,
> + IN_MODIFY);
> + if (file_ctx->wd < 0) {
> + err = errno;
> + DEBUG(0, ("Could not add inotify watch for file [%s].
> Error [%d:%s]\n",
> + file_ctx->filename, err, strerror(err)));
> + close(file_ctx->fd);
> + kill(getpid(), SIGTERM);
> + return;
> + }
> }
Have to nack this.
As discussed on IRC the remove is unnecessary
But the problem is that here you give whatever editor (or human) just 1
second to replace the file.
Please allow more time maybe with a progressive delay scheme (wait
1,2,4,8,16 seconds) after X retries (I guess waiting for 30secs or so is
fine) then give up and kill the daemon.
Haven't checked the rest yet, will do a review of other parts once this
is fixed, unless you want me to review some spcific bits before you fix
this issue.
Simo.
--
Simo Sorce * Red Hat, Inc * New York
More information about the Freeipa-devel
mailing list