/usr/bin/systemctl stop ceph.target > /dev/null 2>&1
fi
-# Now, relabel the files
-/usr/sbin/fixfiles -C ${FILE_CONTEXT}.pre restore 2> /dev/null
+# Relabel the files
+# Use ceph-disk fix for first package install and fixfiles otherwise
+if [ "$1" = "1" ]; then
+ /usr/sbin/ceph-disk fix --selinux
+else
+ /usr/sbin/fixfiles -C ${FILE_CONTEXT}.pre restore 2> /dev/null
+fi
+
rm -f ${FILE_CONTEXT}.pre
# The fixfiles command won't fix label for /var/run/ceph
/usr/sbin/restorecon -R /var/run/ceph > /dev/null 2>&1
def main_fix(args):
# A hash table containing 'path': ('uid', 'gid', blocking, recursive)
fix_table = [
+ ('/usr/bin/ceph-mon', 'ceph', 'ceph', True, False),
+ ('/usr/bin/ceph-mds', 'ceph', 'ceph', True, False),
+ ('/usr/bin/ceph-osd', 'ceph', 'ceph', True, False),
+ ('/usr/bin/radosgw', 'ceph', 'ceph', True, False),
('/etc/ceph', 'ceph', 'ceph', True, True),
('/var/run/ceph', 'ceph', 'ceph', True, True),
('/var/log/ceph', 'ceph', 'ceph', True, True),
+ ('/var/log/radosgw', 'ceph', 'ceph', True, True),
('/var/lib/ceph', 'ceph', 'ceph', True, False),
]