mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 16:12:01 +00:00
25 lines
732 B
Plaintext
25 lines
732 B
Plaintext
|
#!/bin/sh
|
||
|
set -e
|
||
|
|
||
|
if [ -x "/etc/init.d/clickhouse-server" ]; then
|
||
|
update-rc.d clickhouse-server defaults 19 19 >/dev/null || exit $?
|
||
|
fi
|
||
|
|
||
|
useradd -p "" metrika ||:
|
||
|
|
||
|
if id metrika > /dev/null 2>&1; then
|
||
|
mkdir -p /opt/clickhouse/data/default/
|
||
|
mkdir -p /opt/clickhouse/metadata/default/
|
||
|
mkdir -p /opt/cores/
|
||
|
chown metrika: /opt/clickhouse /opt/cores /opt/clickhouse/data /opt/clickhouse/metadata /opt/clickhouse/data/default /opt/clickhouse/metadata/default
|
||
|
# Очистка старых результатов динамической компиляции.
|
||
|
if [ -d "/opt/clickhouse/build" ]; then
|
||
|
rm -f /opt/clickhouse/build/*.cpp /opt/clickhouse/build/*.so ||:
|
||
|
fi
|
||
|
else
|
||
|
echo "User metrika doesn't exist."
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
exit 0
|