From: Zack Cerza Date: Tue, 30 Jun 2015 23:09:33 +0000 (-0600) Subject: syslog: Set SELinux context for logfiles X-Git-Tag: 1.1.0~893^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F555%2Fhead;p=teuthology.git syslog: Set SELinux context for logfiles Signed-off-by: Zack Cerza --- diff --git a/teuthology/task/internal.py b/teuthology/task/internal.py index a57eddf62..421ff6b29 100644 --- a/teuthology/task/internal.py +++ b/teuthology/task/internal.py @@ -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,