]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tasks/ceph: restore context of osd mount path before mkfs
authorKefu Chai <kchai@redhat.com>
Fri, 9 Dec 2016 18:36:52 +0000 (02:36 +0800)
committerSage Weil <sage@redhat.com>
Wed, 14 Dec 2016 15:57:20 +0000 (10:57 -0500)
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 <kchai@redhat.com>
(cherry picked from commit 53225d5272a1d35d4183fcfa55a139f55f77e122)

tasks/ceph.py

index 956a7bfa46af458ef41743faae7aeeef0c1cdba0..ec08457eaa433e280c0c7c09750f25058306986a 100644 (file)
@@ -712,6 +712,12 @@ def cluster(ctx, config):
                         mnt_point,
                     ]
                 )
+                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][role] = mount_options