From e9c7aab6fd86e386849bd638ab247d062d6d840d Mon Sep 17 00:00:00 2001 From: Matthew Heler Date: Tue, 8 Jan 2019 13:42:56 -0600 Subject: [PATCH] [CEPH] Directory OSD regression fix Fix a regression with the Directory OSD logic. Change-Id: I793cf0869bda5c640eb945cbb8190cd89b30c4d0 --- ceph-osd/templates/bin/osd/_directory.sh.tpl | 22 +++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/ceph-osd/templates/bin/osd/_directory.sh.tpl b/ceph-osd/templates/bin/osd/_directory.sh.tpl index 36b97bd9d..d51e4530e 100644 --- a/ceph-osd/templates/bin/osd/_directory.sh.tpl +++ b/ceph-osd/templates/bin/osd/_directory.sh.tpl @@ -72,14 +72,6 @@ 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 - # create the directory and an empty Procfile mkdir -p /etc/forego/"${CLUSTER}" echo "" > /etc/forego/"${CLUSTER}"/Procfile @@ -88,7 +80,7 @@ for OSD_ID in $(ls /var/lib/ceph/osd | sed 's/.*-//'); do OSD_PATH="$OSD_PATH_BASE-$OSD_ID/" OSD_KEYRING="${OSD_PATH%/}/keyring" if [ -n "${JOURNAL_DIR}" ]; then - OSD_J="${JOURNAL_DIR}/journal.${OSD_ID}" + OSD_JOURNAL="${JOURNAL_DIR}/journal.${OSD_ID}" chown -R ceph. ${JOURNAL_DIR} else if [ -n "${JOURNAL}" ]; then @@ -96,12 +88,22 @@ for OSD_ID in $(ls /var/lib/ceph/osd | sed 's/.*-//'); do chown -R ceph. $(dirname ${JOURNAL_DIR}) else OSD_JOURNAL=${OSD_PATH%/}/journal + chown ceph. ${OSD_JOURNAL} fi fi # log osd filesystem type FS_TYPE=`stat --file-system -c "%T" ${OSD_PATH}` echo "OSD $OSD_PATH filesystem type: $FS_TYPE" - echo "${CLUSTER}-${OSD_ID}: /usr/bin/ceph-osd --cluster ${CLUSTER} -f -i ${OSD_ID} --osd-journal ${OSD_JOURNAL} -k $OSD_KEYRING" | tee -a /etc/forego/"${CLUSTER}"/Procfile + + # 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 + + echo "${CLUSTER}-${OSD_ID}: /usr/bin/ceph-osd --cluster ${CLUSTER} -f -i ${OSD_ID} --osd-journal ${OSD_JOURNAL} -k ${OSD_KEYRING}" | tee -a /etc/forego/"${CLUSTER}"/Procfile done exec /usr/local/bin/forego start -f /etc/forego/"${CLUSTER}"/Procfile