提交 27b10bec 编写于 作者: P proller 提交者: alexey-milovidov

debian: Again fix postinst (dont chown not existing dirs) (#501)

* Fix init.d script for all dash versions

* fix

* fix

* debian: Again fix postinst (dont chown not existing dirs)

* fix
上级 abfc1508
......@@ -64,12 +64,17 @@ Please fix this and reinstall this package." >&2
fi
# only for compatibility for old metrika user, remove string after 2017-06-01 :
su -s /bin/sh ${CLICKHOUSE_USER} -c "test -w ${CLICKHOUSE_LOGDIR}" || chown -R root:${CLICKHOUSE_GROUP} ${CLICKHOUSE_LOGDIR}; chmod -R ug+rw ${CLICKHOUSE_LOGDIR}
if [ -d ${CLICKHOUSE_LOGDIR} ]; then
# only for compatibility for old metrika user, remove string after 2017-06-01 :
su -s /bin/sh ${CLICKHOUSE_USER} -c "test -w ${CLICKHOUSE_LOGDIR}" || chown -R root:${CLICKHOUSE_GROUP} ${CLICKHOUSE_LOGDIR}; chmod -R ug+rw ${CLICKHOUSE_LOGDIR}
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
# -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}
# Clean old dynamic compilation results
if [ -d "${CLICKHOUSE_DATADIR}/build" ]; then
......
......@@ -139,7 +139,7 @@ initdb()
# 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
echo "Changing owner of old [${CLICKHOUSE_DATADIR_OLD}] to [${CLICKHOUSE_USER}:${CLICKHOUSE_GROUP}]"
chown -R ${CLICKHOUSE_USER}:${CLICKHOUSE_GROUP} ${CLICKHOUSE_DATADIR_OLD}
chown -RL ${CLICKHOUSE_USER}:${CLICKHOUSE_GROUP} ${CLICKHOUSE_DATADIR_OLD}
fi
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册