mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Debian: Asking password for default user on package install (#4725)
This commit is contained in:
parent
412737bacf
commit
9f1c89729a
@ -0,0 +1 @@
|
||||
keep
|
2
debian/clickhouse-client.postinst
vendored
2
debian/clickhouse-client.postinst
vendored
@ -4,3 +4,5 @@ set -e
|
||||
CLICKHOUSE_USER=${CLICKHOUSE_USER=clickhouse}
|
||||
|
||||
mkdir -p /etc/clickhouse-client/conf.d
|
||||
|
||||
#DEBHELPER#
|
||||
|
1
debian/clickhouse-server-base.postinst
vendored
1
debian/clickhouse-server-base.postinst
vendored
@ -1 +0,0 @@
|
||||
clickhouse-server.postinst
|
1
debian/clickhouse-server-base.preinst
vendored
1
debian/clickhouse-server-base.preinst
vendored
@ -1 +0,0 @@
|
||||
clickhouse-server.preinst
|
1
debian/clickhouse-server-base.prerm
vendored
1
debian/clickhouse-server-base.prerm
vendored
@ -1 +0,0 @@
|
||||
clickhouse-server.prerm
|
1
debian/clickhouse-server-base.service
vendored
1
debian/clickhouse-server-base.service
vendored
@ -1 +0,0 @@
|
||||
clickhouse-server.service
|
1
debian/clickhouse-server-metrika.links
vendored
1
debian/clickhouse-server-metrika.links
vendored
@ -1 +0,0 @@
|
||||
usr/bin/clickhouse usr/bin/clickhouse-server
|
16
debian/clickhouse-server.config
vendored
Normal file
16
debian/clickhouse-server.config
vendored
Normal file
@ -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
|
16
debian/clickhouse-server.postinst
vendored
16
debian/clickhouse-server.postinst
vendored
@ -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 "<yandex><users><default><password>$defaultpassword</password></default></users></yandex>" > ${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
|
||||
|
2
debian/clickhouse-server.preinst
vendored
2
debian/clickhouse-server.preinst
vendored
@ -4,3 +4,5 @@ if [ "$1" = "upgrade" ]; then
|
||||
# Return etc/cron.d/clickhouse-server to original state
|
||||
service clickhouse-server disable_cron ||:
|
||||
fi
|
||||
|
||||
#DEBHELPER#
|
||||
|
3
debian/clickhouse-server.templates
vendored
Normal file
3
debian/clickhouse-server.templates
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
Template: clickhouse-server/default-password
|
||||
Type: password
|
||||
Description: Password for default user.
|
6
debian/rules
vendored
6
debian/rules
vendored
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user