Remove -metrika-yandex postfix from package names (#377)

This commit is contained in:
proller 2017-01-20 22:58:13 +03:00 committed by alexey-milovidov
parent 38040f5323
commit 1adf0bb3e1
8 changed files with 30 additions and 33 deletions

View File

@ -6,7 +6,7 @@
# Будет создан init.d скрипт с названием divider для демона (бинарника) Divider
macro (create_init_script daemonname)
set (filename ${daemonname}-metrika-yandex)
set (filename ${daemonname})
# Опционально принимаем filename вторым аргументом.
set (extra_args ${ARGN})
list (LENGTH extra_args num_extra_args)

View File

@ -18,8 +18,8 @@ echo 'Inserting without increment.txt'
echo "2014-01-01 41" | clickhouse-client --query="INSERT INTO increment.a FORMAT TabSeparated"
ls /opt/clickhouse/data/increment/a/
cat /opt/clickhouse/data/increment/a/increment.txt
sudo /etc/init.d/clickhouse-server-metrika-yandex stop
sudo /etc/init.d/clickhouse-server-metrika-yandex start
sudo /etc/init.d/clickhouse-server stop
sudo /etc/init.d/clickhouse-server start
sleep 10s
ls /opt/clickhouse/data/increment/a/
cat /opt/clickhouse/data/increment/a/increment.txt

View File

@ -13,7 +13,7 @@ echo "('2014-01-01', 'key1', 1, 'val1')" | clickhouse-client --query="INSERT INT
echo "('2014-01-01', 'key1', -1, 'val1'),('2014-01-01', 'key1', 1, 'val2')" | clickhouse-client --query="INSERT INTO collapsing_test.p1 VALUES" || exit 7
echo "('2014-01-01', 'key1', -1, 'val2')" | clickhouse-client --query="INSERT INTO collapsing_test.p2 VALUES" || exit 8
sudo /etc/init.d/clickhouse-server-metrika-yandex stop || exit 10
sudo /etc/init.d/clickhouse-server stop || exit 10
sudo -u metrika cp -r /opt/clickhouse/data/collapsing_test/{p0/20140101_20140101_1_1_0,m0/} || exit 12
sudo -u metrika cp -r /opt/clickhouse/data/collapsing_test/{p1/20140101_20140101_1_1_0,m0/20140101_20140101_2_2_0} || exit 13
@ -21,19 +21,19 @@ sudo -u metrika cp -r /opt/clickhouse/data/collapsing_test/{p1/20140101_20140101
sudo -u metrika cp -r /opt/clickhouse/data/collapsing_test/{p2/20140101_20140101_1_1_0,m1/20140101_20140101_3_3_0} || exit 15
rm /opt/clickhouse/data/collapsing_test/m{0,1}/increment.txt || exit 29
sudo /etc/init.d/clickhouse-server-metrika-yandex start || exit 16
sudo /etc/init.d/clickhouse-server start || exit 16
sleep 10s
echo "OPTIMIZE TABLE collapsing_test.m0" | clickhouse-client || exit 17
echo "OPTIMIZE TABLE collapsing_test.m1" | clickhouse-client || exit 18
sudo /etc/init.d/clickhouse-server-metrika-yandex stop || exit 19
sudo /etc/init.d/clickhouse-server stop || exit 19
sudo -u metrika cp -r /opt/clickhouse/data/collapsing_test/{p0/20140101_20140101_1_1_0,m1/} || exit 20
sudo -u metrika cp -r /opt/clickhouse/data/collapsing_test/{p2/20140101_20140101_1_1_0,m0/20140101_20140101_3_3_0} || exit 21
rm /opt/clickhouse/data/collapsing_test/m{0,1}/increment.txt || exit 29
sudo /etc/init.d/clickhouse-server-metrika-yandex start || exit 22
sudo /etc/init.d/clickhouse-server start || exit 22
sleep 10s
echo "OPTIMIZE TABLE collapsing_test.m0" | clickhouse-client || exit 23

View File

@ -29,7 +29,7 @@ echo 'Files (there should be few non-old_ pieces):'
ls $path
echo 'Stopping server'
sudo /etc/init.d/clickhouse-server-metrika-yandex stop || exit 7
sudo /etc/init.d/clickhouse-server stop || exit 7
echo 'Truncating in half each non-old_ piece with level>1'
pieces=`ls $path | grep -Pv '(^tmp_|^old_|_0$)' | grep -v 'increment.txt'` || exit 8
@ -42,7 +42,7 @@ do
done
echo 'Starting server'
sudo /etc/init.d/clickhouse-server-metrika-yandex start || exit 11
sudo /etc/init.d/clickhouse-server start || exit 11
until echo 'SHOW DATABASES' | clickhouse-client > /dev/null
do

View File

@ -1 +0,0 @@
/usr/bin/config-processor

40
debian/rules vendored
View File

@ -66,7 +66,7 @@ clean:
find ./debian/ -name "*.docs" -type l -delete
rm -f ./debian/copyright
# Удалим созданные *.install файлы
for DAEMON_PKG in ${DAEMONS}; do AUTO=`grep "# automatically created" debian/$$DAEMON_PKG-metrika-yandex.install`; if [ "x$$AUTO" != "x" ]; then rm -f debian/$$DAEMON_PKG-metrika-yandex.install; fi; done
for DAEMON_PKG in ${DAEMONS}; do AUTO=`grep "# automatically created" debian/$$DAEMON_PKG.install`; if [ "x$$AUTO" != "x" ]; then rm -f debian/$$DAEMON_PKG.install; fi; done
dh_clean
install: build
@ -82,7 +82,7 @@ install: build
if [ -e debian/tmp/etc/init.d/clickhouse-server ]; then ln -s tmp/etc/init.d/clickhouse-server debian/clickhouse-server-base.clickhouse-server.init; fi
# создаем дефолтный cron, если нет крон-файла созданного пользователем
# cron_name имеет вид daemonname-metrika-yandex
# cron_name имеет вид daemonname
# Для ClickHouse не должно быть лишних зависимостей.
for I in debian/tmp/etc/init.d/*; \
do \
@ -94,38 +94,36 @@ install: build
echo "#*/10 * * * * root /etc/init.d/$$cron_name condstart 1>/dev/null 2>&1" > debian/tmp/etc/cron.d/$$cron_name; \
fi; \
done; \
# Создаём нужные *.install файлы
# Только для демонов, т.к. пакеты ClickHouse не имеют суффикса metrika-yandex
# Making necessary *.install files
for DAEMON_PKG in ${DAEMONS}; do \
if [ ! -e "debian/$$DAEMON_PKG-metrika-yandex.install" ]; then \
echo "# automatically created" > debian/$$DAEMON_PKG-metrika-yandex.install; \
echo "/etc/$$DAEMON_PKG/config.xml" >> debian/$$DAEMON_PKG-metrika-yandex.install; \
echo "/usr/bin/$$DAEMON_PKG" >> debian/$$DAEMON_PKG-metrika-yandex.install; \
echo "/etc/cron.d/$$DAEMON_PKG-metrika-yandex" >> debian/$$DAEMON_PKG-metrika-yandex.install; \
if [ ! -e "debian/$$DAEMON_PKG.install" ]; then \
echo "# automatically created" > debian/$$DAEMON_PKG.install; \
echo "/etc/$$DAEMON_PKG/config.xml" >> debian/$$DAEMON_PKG.install; \
echo "/usr/bin/$$DAEMON_PKG" >> debian/$$DAEMON_PKG.install; \
echo "/etc/cron.d/$$DAEMON_PKG" >> debian/$$DAEMON_PKG.install; \
if [ -e "debian/tmp/etc/monrun/conf.d/$$DAEMON_PKG.conf" ]; then \
echo "/etc/monrun/conf.d/$$DAEMON_PKG.conf" >> debian/$$DAEMON_PKG-metrika-yandex.install; \
echo "/etc/monrun/conf.d/$$DAEMON_PKG.conf" >> debian/$$DAEMON_PKG.install; \
fi;\
fi; \
done
# Создаём нужные *.postinst файлы
# Note: Только для демонов, т.к. пакеты ClickHouse не имеют суффикса metrika-yandex
# Making necessary *.postinst files
for DAEMON_PKG in ${DAEMONS}; do \
if [ ! -e "debian/$$DAEMON_PKG-metrika-yandex.postinst" ]; then \
echo "# automatically created" > debian/$$DAEMON_PKG-metrika-yandex.postinst; \
echo "mkdir -p /etc/$$DAEMON_PKG/conf.d" >> debian/$$DAEMON_PKG-metrika-yandex.postinst; \
echo "chown -R metrika: /etc/$$DAEMON_PKG" >> debian/$$DAEMON_PKG-metrika-yandex.postinst; \
if [ -e "debian/tmp/etc/init.d/$$DAEMON_PKG-metrika-yandex" ]; then \
if [ ! -e "debian/$$DAEMON_PKG.postinst" ]; then \
echo "# automatically created" > debian/$$DAEMON_PKG.postinst; \
echo "mkdir -p /etc/$$DAEMON_PKG/conf.d" >> debian/$$DAEMON_PKG.postinst; \
echo "chown -R metrika: /etc/$$DAEMON_PKG" >> debian/$$DAEMON_PKG.postinst; \
if [ -e "debian/tmp/etc/init.d/$$DAEMON_PKG" ]; then \
if echo $$DAEMON_PKG | grep server > /dev/null; then\
echo "update-rc.d $$DAEMON_PKG-metrika-yandex defaults > /dev/null || exit \$$?" >> debian/$$DAEMON_PKG-metrika-yandex.postinst; \
echo "update-rc.d $$DAEMON_PKG defaults > /dev/null || exit \$$?" >> debian/$$DAEMON_PKG.postinst; \
else\
echo "update-rc.d $$DAEMON_PKG-metrika-yandex start 30 2 3 4 5 . stop 70 0 1 6 . > /dev/null || exit \$$?" >> debian/$$DAEMON_PKG-metrika-yandex.postinst; \
echo "update-rc.d $$DAEMON_PKG start 30 2 3 4 5 . stop 70 0 1 6 . > /dev/null || exit \$$?" >> debian/$$DAEMON_PKG.postinst; \
fi\
fi\
\
else \
echo >> debian/$$DAEMON_PKG-metrika-yandex.postinst; \
echo "mkdir -p /etc/$$DAEMON_PKG/conf.d; chown -R metrika: /etc/$$DAEMON_PKG" >> debian/$$DAEMON_PKG-metrika-yandex.postinst; \
echo >> debian/$$DAEMON_PKG.postinst; \
echo "mkdir -p /etc/$$DAEMON_PKG/conf.d; chown -R metrika: /etc/$$DAEMON_PKG" >> debian/$$DAEMON_PKG.postinst; \
fi; \
done

View File

@ -4,7 +4,7 @@ function add_daemon_impl {
local daemon=$1
local control=$CONTROL
local dependencies=$2
local description_short="${daemon%-metrika-yandex/ daemon}"
local description_short="${daemon%/ daemon}"
local description_full=$3
echo -e "\n\n" >> $control;
@ -48,7 +48,7 @@ function make_control {
#skip it explicitly
;;
* )
add_daemon_impl "${DAEMON_PKG}-metrika-yandex"
add_daemon_impl "${DAEMON_PKG}"
;;
esac
done