Moved chown to correct place [#CLICKHOUSE-2].

This commit is contained in:
Alexey Milovidov 2017-10-11 22:11:51 +03:00
parent bbc5120c23
commit 041623dee1
2 changed files with 4 additions and 7 deletions

View File

@ -5,7 +5,6 @@ CLICKHOUSE_USER=clickhouse
CLICKHOUSE_GROUP=${CLICKHOUSE_USER}
CLICKHOUSE_DATADIR=/var/lib/clickhouse
CLICKHOUSE_LOGDIR=/var/log/clickhouse-server
CLICKHOUSE_SERVER_ETCDIR=/etc/clickhouse-server
if [ "$1" = configure ]; then
@ -63,12 +62,6 @@ Please fix this and reinstall this package." >&2
fi
if [ -d ${CLICKHOUSE_SERVER_ETCDIR} ]; then
# -R only for compatibility for old metrika user, remove -R after 2017-06-01
su -s /bin/sh ${CLICKHOUSE_USER} -c "test -w ${CLICKHOUSE_SERVER_ETCDIR}" || chown -R ${CLICKHOUSE_USER}:${CLICKHOUSE_GROUP} ${CLICKHOUSE_SERVER_ETCDIR}
fi
# Clean old dynamic compilation results
if [ -d "${CLICKHOUSE_DATADIR}/build" ]; then
rm -f ${CLICKHOUSE_DATADIR}/build/*.cpp ${CLICKHOUSE_DATADIR}/build/*.so ||:

View File

@ -95,6 +95,10 @@ check_config()
initdb()
{
if [ -d ${SYSCONFDIR} ]; then
su -s /bin/sh ${CLICKHOUSE_USER} -c "test -w ${SYSCONFDIR}" || chown ${CLICKHOUSE_USER}:${CLICKHOUSE_GROUP} ${SYSCONFDIR}
fi
if [ -x "$BINDIR/$GENERIC_PROGRAM" ]; then
CLICKHOUSE_DATADIR_FROM_CONFIG=$(su -s $SHELL ${CLICKHOUSE_USER} -c "$BINDIR/$GENERIC_PROGRAM extract-from-config --config-file=\"$CLICKHOUSE_CONFIG\" --key=path")
if [ "(" "$?" -ne "0" ")" -o "(" -z "${CLICKHOUSE_DATADIR_FROM_CONFIG}" ")" ]; then