From: Kefu Chai Date: Fri, 9 Dec 2016 18:36:52 +0000 (+0800) Subject: tasks/ceph: restore context of osd mount path before mkfs X-Git-Tag: v0.94.10~27^2^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=87e0299448908775600c62130617bad503027768;p=ceph.git tasks/ceph: restore context of osd mount path before mkfs all newly created files and directories under the mount dir inherit the SELinux type of their parent directory. so we need to set it before mkfs. Fixes: http://tracker.ceph.com/issues/16800 Signed-off-by: Kefu Chai (cherry picked from commit 53225d5272a1d35d4183fcfa55a139f55f77e122) --- diff --git a/tasks/ceph.py b/tasks/ceph.py index 466cd17d9d10..c5227adb250b 100644 --- a/tasks/ceph.py +++ b/tasks/ceph.py @@ -590,6 +590,12 @@ def cluster(ctx, config): os.path.join('/var/lib/ceph/osd', 'ceph-{id}'.format(id=id_)), ] ) + remote.run( + args=[ + 'sudo', '/sbin/restorecon', mnt_point, + ], + check_status=False, + ) if not remote in ctx.disk_config.remote_to_roles_to_dev_mount_options: ctx.disk_config.remote_to_roles_to_dev_mount_options[remote] = {} ctx.disk_config.remote_to_roles_to_dev_mount_options[remote][id_] = mount_options