trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zw...@apache.org
Subject [01/12] git commit: TS-2304 Make the healthcheck plugin watch for file permission changes
Date Thu, 30 Jan 2014 23:31:14 GMT
Updated Branches:
  refs/heads/5.0.x 10dc9f728 -> 3a1fcd475


TS-2304 Make the healthcheck plugin watch for file permission changes


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/c952398f
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/c952398f
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/c952398f

Branch: refs/heads/5.0.x
Commit: c952398ff733b119337d0406f21e2e32eddd2e4a
Parents: 77e2776
Author: Leif Hedstrom <zwoop@apache.org>
Authored: Thu Jan 23 09:10:47 2014 -0700
Committer: Leif Hedstrom <zwoop@apache.org>
Committed: Mon Jan 27 14:27:17 2014 -0700

----------------------------------------------------------------------
 plugins/experimental/healthchecks/healthchecks.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c952398f/plugins/experimental/healthchecks/healthchecks.c
----------------------------------------------------------------------
diff --git a/plugins/experimental/healthchecks/healthchecks.c b/plugins/experimental/healthchecks/healthchecks.c
index bb27505..89ee7a9 100644
--- a/plugins/experimental/healthchecks/healthchecks.c
+++ b/plugins/experimental/healthchecks/healthchecks.c
@@ -153,7 +153,7 @@ setup_watchers(int fd)
   char *dname;
 
   while (conf) {
-    conf->wd = inotify_add_watch(fd, conf->fname, IN_DELETE_SELF|IN_CLOSE_WRITE);
+    conf->wd = inotify_add_watch(fd, conf->fname, IN_DELETE_SELF|IN_CLOSE_WRITE|IN_ATTRIB);
     TSDebug(PLUGIN_NAME, "Setting up a watcher for %s", conf->fname);
     strncpy(fname, conf->fname, MAX_FILENAME_LEN - 1);
     dname = dirname(fname);
@@ -163,7 +163,7 @@ setup_watchers(int fd)
       dir = TSmalloc(sizeof(HCDirEntry));
       memset(dir, 0, sizeof(HCDirEntry));
       strncpy(dir->dname, dname, MAX_FILENAME_LEN - 1);
-      dir->wd = inotify_add_watch(fd, dname, IN_CREATE|IN_MOVED_FROM|IN_MOVED_TO);
+      dir->wd = inotify_add_watch(fd, dname, IN_CREATE|IN_MOVED_FROM|IN_MOVED_TO|IN_ATTRIB);
       if (!head_dir)
         head_dir = dir;
       else
@@ -242,7 +242,7 @@ hc_thread(void *data ATS_UNUSED)
           HCFileData *new_data = TSmalloc(sizeof(HCFileData));
           HCFileData *old_data;
 
-          if (event->mask & (IN_CLOSE_WRITE)) {
+          if (event->mask & (IN_CLOSE_WRITE|IN_ATTRIB)) {
             TSDebug(PLUGIN_NAME, "Modify file event (%d) on %s", event->mask, finfo->fname);
           } else if (event->mask & (IN_CREATE|IN_MOVED_TO)) {
             TSDebug(PLUGIN_NAME, "Create file event (%d) on %s", event->mask, finfo->fname);


Mime
View raw message