From 3489e5cd93f01819ed133384cacc5730cf199e15 Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Wed, 5 Aug 2015 10:08:35 -0600 Subject: [PATCH] Set the SELinux context of the logrotate config Signed-off-by: Zack Cerza (cherry picked from commit e195f9fa1c3415157ce7be0bb50aead9794f49f1) --- tasks/ceph.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tasks/ceph.py b/tasks/ceph.py index 21dc2686a6be8..604b4004841dd 100644 --- a/tasks/ceph.py +++ b/tasks/ceph.py @@ -93,7 +93,7 @@ def ceph_log(ctx, config): def end(self): self.stop_event.set() self.thread.get() - + def write_rotate_conf(ctx, daemons): testdir = teuthology.get_testdir(ctx) rotate_conf_path = os.path.join(os.path.dirname(__file__), 'logrotate.conf') @@ -103,7 +103,7 @@ def ceph_log(ctx, config): log.info('writing logrotate stanza for {daemon}'.format(daemon=daemon)) conf += f.read().format(daemon_type=daemon,max_size=size) f.seek(0, 0) - + for remote in ctx.cluster.remotes.iterkeys(): teuthology.write_file(remote=remote, path='{tdir}/logrotate.ceph-test.conf'.format(tdir=testdir), @@ -126,6 +126,8 @@ def ceph_log(ctx, config): 'root.root', '/etc/logrotate.d/ceph-test.conf' ] + remote.chcon('/etc/logrotate.d/ceph-test.conf', + 'system_u:object_r:etc_t:s0') ) if ctx.config.get('log-rotate'): @@ -1095,7 +1097,7 @@ def created_pool(ctx, config): if new_pool not in ctx.manager.pools: ctx.manager.pools[new_pool] = ctx.manager.get_pool_property( new_pool, 'pg_num') - + @contextlib.contextmanager def restart(ctx, config): -- 2.39.5