Set owner on watcher pause and queue drain files
authorMichael Hanselmann <hansmi@google.com>
Tue, 11 Dec 2012 13:29:45 +0000 (14:29 +0100)
committerMichael Hanselmann <hansmi@google.com>
Tue, 11 Dec 2012 14:31:56 +0000 (15:31 +0100)
If the files were created by a user different, e.g. due to a switch from
running masterd as root to running it as a dedicated user, they couldn't
be modified/removed anymore.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

lib/tools/ensure_dirs.py

index 8e72b0d..b50e37e 100644 (file)
@@ -164,6 +164,10 @@ def GetPaths():
      getent.masterd_uid, getent.masterd_gid, False),
     (pathutils.JOB_QUEUE_ARCHIVE_DIR, DIR, 0700,
      getent.masterd_uid, getent.masterd_gid),
+    (pathutils.WATCHER_PAUSEFILE, FILE, 0644,
+     getent.masterd_uid, getent.masterd_gid, False),
+    (pathutils.JOB_QUEUE_DRAIN_FILE, FILE, 0644,
+     getent.masterd_uid, getent.masterd_gid, False),
     (rapi_dir, DIR, 0750, getent.rapi_uid, getent.masterd_gid),
     (pathutils.RAPI_USERS_FILE, FILE, 0640,
      getent.rapi_uid, getent.masterd_gid, False),