]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
syslog: Set SELinux context for logfiles 555/head
authorZack Cerza <zack@redhat.com>
Tue, 30 Jun 2015 23:09:33 +0000 (17:09 -0600)
committerZack Cerza <zack@redhat.com>
Tue, 30 Jun 2015 23:09:52 +0000 (17:09 -0600)
Signed-off-by: Zack Cerza <zack@redhat.com>
teuthology/task/internal.py

index a57eddf62e84caf9a0a86889f629ca27e9ad4862..421ff6b29782100f38803a256c93eb93cd04e8af 100644 (file)
@@ -603,6 +603,13 @@ def syslog(ctx, config):
     conf_fp = StringIO('\n'.join(conf_lines))
     try:
         for rem in ctx.cluster.remotes.iterkeys():
+            if rem.os.package_type == 'rpm':
+                log_context = 'system_u:object_r:var_log_t:s0'
+                for log_path in (kern_log, misc_log):
+                    rem.run(
+                        args="touch {log} && sudo chcon {con} {log}".format(
+                            log=log_path, con=log_context),
+                    )
             misc.sudo_write_file(
                 remote=rem,
                 path=CONF,