From dc66254c4244158dd537053a38fbd42f7208497b Mon Sep 17 00:00:00 2001 From: Chinasubbareddy Mallavarapu Date: Tue, 23 Jul 2019 10:40:53 -0500 Subject: [PATCH] Ceph-RGW: fix file permision issue This is to fix the issue we are facing with file permision on the file /var/lib/ceph/bootstrap-rgw/ceph.keyring since owner of the file will be root. This is happening when node with rgw reboots and rgw pods fails at init after reboot,this is happening on sinlge node deplyoments. issue: ceph-rgw-5db485fbd9-dv778 0/1 Init:CrashLoopBackOff 5 6m49s logs: + chown -R ceph. /run/ceph/ /var/lib/ceph/bootstrap-rgw /var/lib/ceph/radosgw /var/lib/ceph/tmp chown: changing ownership of '/var/lib/ceph/bootstrap-rgw/ceph.keyring': Operation not permitted Change-Id: Idcb648c205053b2f03357b59173e70e02f28688c --- ceph-rgw/templates/bin/_init-dirs.sh.tpl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ceph-rgw/templates/bin/_init-dirs.sh.tpl b/ceph-rgw/templates/bin/_init-dirs.sh.tpl index fc82bdb84..f09e7ebd4 100644 --- a/ceph-rgw/templates/bin/_init-dirs.sh.tpl +++ b/ceph-rgw/templates/bin/_init-dirs.sh.tpl @@ -37,5 +37,8 @@ mkdir -p /run/ceph # Creating rados directories mkdir -p "/var/lib/ceph/radosgw/${RGW_NAME}" +# Clean the folder +rm -f "$(dirname "${RGW_BOOTSTRAP_KEYRING}"/*)" + # Adjust the owner of all those directories chown -R ceph. /run/ceph/ /var/lib/ceph/*