Fix issue where redis is unable to write on re-configure

The configure code path now ensures the volume which ends up
changing the ownership of the data directory. This means that the
redis container which is still running cannot write anymore
when it is re-created as part of setupAddons().

Just change ownership of top level directory. The subdirectores
like data/ redis/ are owned by containers which will chown
accordingly.
This commit is contained in:
Girish Ramakrishnan
2017-02-20 13:32:05 -08:00
parent 2108c61d97
commit 7035b3c18a
+4 -2
View File
@@ -26,10 +26,12 @@ if [[ "${BOX_ENV}" == "cloudron" ]]; then
fi
mkdir -p "${app_data_dir}/data"
chown -R yellowtent:yellowtent "${app_data_dir}"
# only the top level ownership is changed because containers own the subdirectores
# and will chown them as necessary
chown yellowtent:yellowtent "${app_data_dir}"
else
readonly app_data_dir="${HOME}/.cloudron_test/data/$1"
mkdir -p "${app_data_dir}/data"
chown -R ${SUDO_USER}:${SUDO_USER} "${app_data_dir}"
chown ${SUDO_USER}:${SUDO_USER} "${app_data_dir}"
fi