[CEPH] OSD directory permission fixes

In the event the base image is changed, the uid of the ceph OSD
directory may not align with the uid of the ceph user of the image.
In this case we check permissions and set them correctly.

Change-Id: I3bef7f6323d1de7c62320ccd423c929349bedb42
This commit is contained in:
Matthew Heler 2019-01-07 15:37:53 -06:00
parent 0770465962
commit 4a85c21996
2 changed files with 10 additions and 0 deletions

View File

@ -99,6 +99,11 @@ if [ "${OSD_BLUESTORE:-0}" -ne 1 ]; then
fi
fi
# NOTE(supamatt): Just in case permissions do not align up, we recursively set them correctly.
if [ $(stat -c%U ${OSD_PATH}) != ceph ]; then
chown -R ceph. ${OSD_PATH};
fi
if [ "${OSD_BLUESTORE:-0}" -ne 1 ]; then
# NOTE(supamatt): This function is a workaround to Ceph upstream bug #21142
osd_pg_interval_fix

View File

@ -72,6 +72,11 @@ if [[ -n "$(find /var/lib/ceph/osd -prune -empty)" ]]; then
crush_location
fi
# NOTE(supamatt): Just in case permissions do not align up, we recursively set them correctly.
if [ $(stat -c%U ${OSD_PATH}) != ceph ]; then
chown -R ceph. ${OSD_PATH};
fi
# NOTE(supamatt): This function is a workaround to Ceph upstream bug #21142
osd_pg_interval_fix