diff --git a/dbms/tests/integration/test_external_dictionaries/configs/dictionaries/.gitkeep b/dbms/tests/integration/test_external_dictionaries/configs/dictionaries/.gitkeep index e69de29bb2d..c693f138c81 100644 --- a/dbms/tests/integration/test_external_dictionaries/configs/dictionaries/.gitkeep +++ b/dbms/tests/integration/test_external_dictionaries/configs/dictionaries/.gitkeep @@ -0,0 +1 @@ +keep \ No newline at end of file diff --git a/debian/clickhouse-client.postinst b/debian/clickhouse-client.postinst index 38d2450dcbe..480bf2f5c67 100644 --- a/debian/clickhouse-client.postinst +++ b/debian/clickhouse-client.postinst @@ -4,3 +4,5 @@ set -e CLICKHOUSE_USER=${CLICKHOUSE_USER=clickhouse} mkdir -p /etc/clickhouse-client/conf.d + +#DEBHELPER# diff --git a/debian/clickhouse-server-base.postinst b/debian/clickhouse-server-base.postinst deleted file mode 120000 index 42fbd368922..00000000000 --- a/debian/clickhouse-server-base.postinst +++ /dev/null @@ -1 +0,0 @@ -clickhouse-server.postinst \ No newline at end of file diff --git a/debian/clickhouse-server-base.preinst b/debian/clickhouse-server-base.preinst deleted file mode 120000 index dbc74e163bf..00000000000 --- a/debian/clickhouse-server-base.preinst +++ /dev/null @@ -1 +0,0 @@ -clickhouse-server.preinst \ No newline at end of file diff --git a/debian/clickhouse-server-base.prerm b/debian/clickhouse-server-base.prerm deleted file mode 120000 index 03f62e02475..00000000000 --- a/debian/clickhouse-server-base.prerm +++ /dev/null @@ -1 +0,0 @@ -clickhouse-server.prerm \ No newline at end of file diff --git a/debian/clickhouse-server-base.service b/debian/clickhouse-server-base.service deleted file mode 120000 index b00af30916c..00000000000 --- a/debian/clickhouse-server-base.service +++ /dev/null @@ -1 +0,0 @@ -clickhouse-server.service \ No newline at end of file diff --git a/debian/clickhouse-server-metrika.links b/debian/clickhouse-server-metrika.links deleted file mode 100644 index 037f5272b94..00000000000 --- a/debian/clickhouse-server-metrika.links +++ /dev/null @@ -1 +0,0 @@ -usr/bin/clickhouse usr/bin/clickhouse-server diff --git a/debian/clickhouse-server.config b/debian/clickhouse-server.config new file mode 100644 index 00000000000..749e8781347 --- /dev/null +++ b/debian/clickhouse-server.config @@ -0,0 +1,16 @@ +#!/bin/sh -e + +. /usr/share/debconf/confmodule + +db_fget clickhouse-server/default-password seen || true +password_seen="$RET" + +if [ "$1" = "reconfigure" ]; then + password_seen=false +fi + +if [ "$password_seen" != "true" ]; then + db_input high clickhouse-server/default-password || true + db_go || true +fi +db_go || true diff --git a/debian/clickhouse-server.postinst b/debian/clickhouse-server.postinst index 6746aae889c..1e9e2c310db 100644 --- a/debian/clickhouse-server.postinst +++ b/debian/clickhouse-server.postinst @@ -11,9 +11,10 @@ CLICKHOUSE_GENERIC_PROGRAM=${CLICKHOUSE_GENERIC_PROGRAM:=clickhouse} EXTRACT_FROM_CONFIG=${CLICKHOUSE_GENERIC_PROGRAM}-extract-from-config CLICKHOUSE_CONFIG=$CLICKHOUSE_CONFDIR/config.xml - OS=${OS=`lsb_release -is 2>/dev/null || uname -s ||:`} +. /usr/share/debconf/confmodule + test -f /etc/default/clickhouse && . /etc/default/clickhouse if [ "$1" = configure ]; then @@ -84,6 +85,8 @@ Please fix this and reinstall this package." >&2 fi if [ -d ${CLICKHOUSE_CONFDIR} ]; then + mkdir -p ${CLICKHOUSE_CONFDIR}/users.d + mkdir -p ${CLICKHOUSE_CONFDIR}/config.d rm -fv ${CLICKHOUSE_CONFDIR}/*-preprocessed.xml ||: fi @@ -119,4 +122,15 @@ Please fix this and reinstall this package." >&2 if [ -d "${CLICKHOUSE_DATADIR_FROM_CONFIG}/build" ]; then rm -f ${CLICKHOUSE_DATADIR_FROM_CONFIG}/build/*.cpp ${CLICKHOUSE_DATADIR_FROM_CONFIG}/build/*.so ||: fi + + db_get clickhouse-server/default-password + defaultpassword="$RET" + if [ -n "$defaultpassword" ]; then + echo "$defaultpassword" > ${CLICKHOUSE_CONFDIR}/users.d/default-password.xml + fi + + # everything went well, so now let's reset the password + db_set clickhouse-server/default-password "" + # ... done with debconf here + db_stop fi diff --git a/debian/clickhouse-server.preinst b/debian/clickhouse-server.preinst index 1435d8db8da..3529aefa7da 100644 --- a/debian/clickhouse-server.preinst +++ b/debian/clickhouse-server.preinst @@ -4,3 +4,5 @@ if [ "$1" = "upgrade" ]; then # Return etc/cron.d/clickhouse-server to original state service clickhouse-server disable_cron ||: fi + +#DEBHELPER# diff --git a/debian/clickhouse-server.templates b/debian/clickhouse-server.templates new file mode 100644 index 00000000000..3053c18c79f --- /dev/null +++ b/debian/clickhouse-server.templates @@ -0,0 +1,3 @@ +Template: clickhouse-server/default-password +Type: password +Description: Password for default user. diff --git a/debian/rules b/debian/rules index cb0c5137f18..0916b99f638 100755 --- a/debian/rules +++ b/debian/rules @@ -123,9 +123,9 @@ override_dh_install: touch $(DESTDIR)/etc/clickhouse-server/metrika/users.xml # todo: remove after removing clickhouse-server-base package: - mkdir -p $(DESTDIR)/etc/init.d $(DESTDIR)/etc/cron.d - cp debian/clickhouse-server.init $(DESTDIR)/etc/init.d/clickhouse-server - cp debian/clickhouse-server.cron.d $(DESTDIR)/etc/cron.d/clickhouse-server + #mkdir -p $(DESTDIR)/etc/init.d $(DESTDIR)/etc/cron.d + #cp debian/clickhouse-server.init $(DESTDIR)/etc/init.d/clickhouse-server + #cp debian/clickhouse-server.cron.d $(DESTDIR)/etc/cron.d/clickhouse-server dh_install --list-missing --sourcedir=$(DESTDIR)