]> 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)
committerKefu Chai <kchai@redhat.com>
Wed, 14 Dec 2016 11:15:16 +0000 (19:15 +0800)
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>
tasks/ceph.py

index e05ab9b94c9396f568f9a21e5004b59428418f59..1a3cbe2ce005e3a6a431b1257455e8af20d0c974 100644 (file)
@@ -752,6 +752,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