diff --git a/ceph-osd/templates/bin/osd/_block.sh.tpl b/ceph-osd/templates/bin/osd/_block.sh.tpl index 9cfd34402..eed6a790c 100644 --- a/ceph-osd/templates/bin/osd/_block.sh.tpl +++ b/ceph-osd/templates/bin/osd/_block.sh.tpl @@ -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 diff --git a/ceph-osd/templates/bin/osd/_directory.sh.tpl b/ceph-osd/templates/bin/osd/_directory.sh.tpl index 00e504b9f..36b97bd9d 100644 --- a/ceph-osd/templates/bin/osd/_directory.sh.tpl +++ b/ceph-osd/templates/bin/osd/_directory.sh.tpl @@ -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