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)
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