Merge branch 'master' of github.com:yandex/ClickHouse

This commit is contained in:
Alexey Milovidov 2017-02-14 00:13:41 +03:00
commit 1ef225be92
2 changed files with 5 additions and 8 deletions

View File

@ -45,25 +45,22 @@ Please fix this and reinstall this package." >&2
fi fi
if [ ! -d ${CLICKHOUSE_DATADIR} ]; then if [ ! -d ${CLICKHOUSE_DATADIR} ]; then
# only for compatibility for old /opt/clickhouse, remove after 2017-06-01 # only for compatibility for old /opt/clickhouse, remove after 2017-06-01
if [ -d ${CLICKHOUSE_DATADIR_OLD} ]; then if [ -d ${CLICKHOUSE_DATADIR_OLD} ]; then
ln -s ${CLICKHOUSE_DATADIR_OLD} ${CLICKHOUSE_DATADIR} ln -s ${CLICKHOUSE_DATADIR_OLD} ${CLICKHOUSE_DATADIR}
else else
# DONT remove after 2017-06-01 : # DONT remove after 2017-06-01 :
mkdir -p ${CLICKHOUSE_DATADIR} mkdir -p ${CLICKHOUSE_DATADIR}
fi
# ensure home directory ownership
#su -s /bin/sh clickhouse -c "test -O /var/lib/clickhouse && test -G /var/lib/clickhouse" || \
chown ${CLICKHOUSE_USER}:${CLICKHOUSE_GROUP} ${CLICKHOUSE_DATADIR} chown ${CLICKHOUSE_USER}:${CLICKHOUSE_GROUP} ${CLICKHOUSE_DATADIR}
chmod 700 ${CLICKHOUSE_DATADIR} chmod 700 ${CLICKHOUSE_DATADIR}
fi fi
fi
if [ ! -d ${CLICKHOUSE_LOGDIR} ]; then if [ ! -d ${CLICKHOUSE_LOGDIR} ]; then
mkdir -p ${CLICKHOUSE_LOGDIR} mkdir -p ${CLICKHOUSE_LOGDIR}
chown root:${CLICKHOUSE_GROUP} ${CLICKHOUSE_LOGDIR} chown root:${CLICKHOUSE_GROUP} ${CLICKHOUSE_LOGDIR}
chmod 770 ${CLICKHOUSE_LOGDIR} # Allow everyone to read logs, root and clickhouse to read-write
chmod 775 ${CLICKHOUSE_LOGDIR}
fi fi

View File

@ -135,7 +135,7 @@ initdb()
fi fi
#Temporary fix for old metrika user, remove after 2017-06-01 #Temporary fix for old metrika user, remove after 2017-06-01
if [ ! -z ${CLICKHOUSE_DATADIR_OLD} ] && [ -d ${CLICKHOUSE_DATADIR_OLD} ] && [ ! `su -s $SHELL ${CLICKHOUSE_USER} -c "test -w ${CLICKHOUSE_DATADIR_OLD}"` ]; then if [ ! -z ${CLICKHOUSE_DATADIR_OLD} ] && [ -d ${CLICKHOUSE_DATADIR_OLD} ] && ! `su -s $SHELL ${CLICKHOUSE_USER} -c "test -w ${CLICKHOUSE_DATADIR_OLD}"` ; then
echo "Changing owner of old [${CLICKHOUSE_DATADIR_OLD}] to [${CLICKHOUSE_USER}:${CLICKHOUSE_GROUP}]" echo "Changing owner of old [${CLICKHOUSE_DATADIR_OLD}] to [${CLICKHOUSE_USER}:${CLICKHOUSE_GROUP}]"
chown -R ${CLICKHOUSE_USER}:${CLICKHOUSE_GROUP} ${CLICKHOUSE_DATADIR_OLD} chown -R ${CLICKHOUSE_USER}:${CLICKHOUSE_GROUP} ${CLICKHOUSE_DATADIR_OLD}
fi fi