...
 
Commits (9)
#
# sudo apt install pbuilder fakeroot debhelper debian-archive-keyring debian-keyring
#
# ubuntu:
# prepare old (trusty or earlier) host system:
# sudo ln -s gutsy /usr/share/debootstrap/scripts/artful
# sudo ln -s gutsy /usr/share/debootstrap/scripts/bionic
# build ubuntu:
# sudo DIST=trusty pbuilder create --configfile debian/.pbuilderrc && DIST=trusty pdebuild --configfile debian/.pbuilderrc
# sudo DIST=xenial pbuilder create --configfile debian/.pbuilderrc && DIST=xenial pdebuild --configfile debian/.pbuilderrc
# sudo DIST=zesty pbuilder create --configfile debian/.pbuilderrc && DIST=zesty pdebuild --configfile debian/.pbuilderrc
# sudo DIST=artful pbuilder create --configfile debian/.pbuilderrc && DIST=artful pdebuild --configfile debian/.pbuilderrc
# sudo DIST=bionic pbuilder create --configfile debian/.pbuilderrc && DIST=bionic pdebuild --configfile debian/.pbuilderrc
# sudo DIST=devel pbuilder create --configfile debian/.pbuilderrc && DIST=devel pdebuild --configfile debian/.pbuilderrc
# build debian:
# sudo DIST=stable pbuilder create --configfile debian/.pbuilderrc && DIST=stable pdebuild --configfile debian/.pbuilderrc
# sudo DIST=testing pbuilder create --configfile debian/.pbuilderrc && DIST=testing pdebuild --configfile debian/.pbuilderrc
# sudo DIST=unstable pbuilder create --configfile debian/.pbuilderrc && DIST=unstable pdebuild --configfile debian/.pbuilderrc
# sudo DIST=experimental pbuilder create --configfile debian/.pbuilderrc && DIST=experimental pdebuild --configfile debian/.pbuilderrc
# build i386 experimental:
# sudo DIST=trusty ARCH=i386 pbuilder create --configfile debian/.pbuilderrc && DIST=trusty ARCH=i386 pdebuild --configfile debian/.pbuilderrc
# sudo DIST=xenial ARCH=i386 pbuilder create --configfile debian/.pbuilderrc && DIST=xenial ARCH=i386 pdebuild --configfile debian/.pbuilderrc
# sudo DIST=zesty ARCH=i386 pbuilder create --configfile debian/.pbuilderrc && DIST=zesty ARCH=i386 pdebuild --configfile debian/.pbuilderrc
# sudo DIST=artful ARCH=i386 pbuilder create --configfile debian/.pbuilderrc && DIST=artful ARCH=i386 pdebuild --configfile debian/.pbuilderrc
# sudo DIST=bionic ARCH=i386 pbuilder create --configfile debian/.pbuilderrc && DIST=bionic ARCH=i386 pdebuild --configfile debian/.pbuilderrc
# sudo DIST=stable ARCH=i386 pbuilder create --configfile debian/.pbuilderrc && DIST=stable ARCH=i386 pdebuild --configfile debian/.pbuilderrc
# sudo DIST=testing ARCH=i386 pbuilder create --configfile debian/.pbuilderrc && DIST=testing ARCH=i386 pdebuild --configfile debian/.pbuilderrc
# sudo DIST=experimental ARCH=i386 pbuilder create --configfile debian/.pbuilderrc && DIST=experimental ARCH=i386 pdebuild --configfile debian/.pbuilderrc
# use only clang:
# env DEB_CC=clang-5.0 DEB_CXX=clang++-5.0 EXTRAPACKAGES="clang-5.0" DIST=artful pdebuild --configfile debian/.pbuilderrc
# clang+asan:
# env DEB_CC=clang-5.0 DEB_CXX=clang++-5.0 EXTRAPACKAGES="clang-5.0 libc++abi-dev libc++-dev" CMAKE_FLAGS="-DENABLE_TCMALLOC=0 -DENABLE_UNWIND=0 -DCMAKE_BUILD_TYPE=Asan" DIST=artful pdebuild --configfile debian/.pbuilderrc
# clang+tsan:
# env DEB_CC=clang-5.0 DEB_CXX=clang++-5.0 EXTRAPACKAGES="clang-5.0 libc++abi-dev libc++-dev" CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=Tsan" DIST=artful pdebuild --configfile debian/.pbuilderrc
# without sse for old systems and some VM:
# env DH_VERBOSE=1 CMAKE_FLAGS="-DHAVE_SSE41=0 -DHAVE_SSE42=0 -DHAVE_POPCNT=0 -DHAVE_SSE2_INTRIN=0 -DSSE2FLAG=' ' -DHAVE_SSE42_INTRIN=0 -DSSE4FLAG=' ' -DHAVE_PCLMULQDQ_INTRIN=0 -DPCLMULFLAG=' '" DIST=artful pdebuild --configfile debian/.pbuilderrc
# Note: on trusty host creating some future dists can fail (debootstrap error).
# Your packages built here: /var/cache/pbuilder/*-*/result
# from https://wiki.debian.org/PbuilderTricks :
# Codenames for Debian suites according to their alias. Update these when
# needed.
UNSTABLE_CODENAME="sid"
TESTING_CODENAME="buster"
STABLE_CODENAME="stretch"
STABLE_BACKPORTS_SUITE="$STABLE_CODENAME-backports"
# List of Debian suites.
DEBIAN_SUITES=($UNSTABLE_CODENAME $TESTING_CODENAME $STABLE_CODENAME $STABLE_BACKPORTS_SUITE
"experimental" "unstable" "testing" "stable")
# List of Ubuntu suites. Update these when needed.
UBUNTU_SUITES=("cosmic" "bionic" "artful" "zesty" "xenial" "trusty" "devel")
# Set a default distribution if none is used. Note that you can set your own default (i.e. ${DIST:="unstable"}).
HOST_DIST=`lsb_release --short --codename`
: ${DIST:="$HOST_DIST"}
# Optionally change Debian codenames in $DIST to their aliases.
case "$DIST" in
$UNSTABLE_CODENAME)
DIST="unstable"
;;
$TESTING_CODENAME)
DIST="testing"
;;
$STABLE_CODENAME)
DIST="stable"
;;
esac
# Optionally set the architecture to the host architecture if none set. Note
# that you can set your own default (i.e. ${ARCH:="i386"}).
: ${ARCH:="$(dpkg --print-architecture)"}
NAME="$DIST"
if [ -n "${ARCH}" ]; then
NAME="$NAME-$ARCH"
DEBOOTSTRAPOPTS=("--arch" "$ARCH" "${DEBOOTSTRAPOPTS[@]}")
fi
BASETGZ=${SET_BASETGZ}
BASETGZ=${BASETGZ:="/var/cache/pbuilder/$NAME-base.tgz"}
DISTRIBUTION="$DIST"
BUILDRESULT=${SET_BUILDRESULT}
BUILDRESULT=${BUILDRESULT:="/var/cache/pbuilder/$NAME/result/"}
APTCACHE="/var/cache/pbuilder/$NAME/aptcache/"
BUILDPLACE="/var/cache/pbuilder/build/"
ALLOWUNTRUSTED=${SET_ALLOWUNTRUSTED:=${ALLOWUNTRUSTED}}
#DEBOOTSTRAPOPTS=( '--variant=buildd' $SET_DEBOOTSTRAPOPTS )
if $(echo ${DEBIAN_SUITES[@]} | grep -q $DIST); then
# Debian configuration
OSNAME=debian
#MIRRORSITE=${SET_MIRRORSITE="http://deb.debian.org/$OSNAME/"}
MIRRORSITE=${SET_MIRRORSITE="http://mirror.yandex.ru/$OSNAME/"}
COMPONENTS="main contrib non-free"
if $(echo "$STABLE_CODENAME stable" | grep -q $DIST); then
OTHERMIRROR="$OTHERMIRROR | deb $MIRRORSITE $STABLE_BACKPORTS_SUITE $COMPONENTS"
fi
# APTKEYRINGS=/usr/share/keyrings/debian-archive-keyring.gpg
case "$HOST_DIST" in
"trusty" )
DEBOOTSTRAPOPTS+=( '--no-check-gpg' )
;;
*)
DEBOOTSTRAPOPTS+=( '--keyring' '/usr/share/keyrings/debian-archive-keyring.gpg' )
# DEBOOTSTRAPOPTS+=( '--keyring' '/usr/share/keyrings/debian-keyring.gpg' )
esac
elif $(echo ${UBUNTU_SUITES[@]} | grep -q $DIST); then
# Ubuntu configuration
OSNAME=ubuntu
if [[ "$ARCH" == "amd64" || "$ARCH" == "i386" ]]; then
#MIRRORSITE=${SET_MIRRORSITE="http://archive.ubuntu.com/$OSNAME/"}
MIRRORSITE=${SET_MIRRORSITE="http://mirror.yandex.ru/$OSNAME/"}
else
MIRRORSITE=${SET_MIRRORSITE="http://ports.ubuntu.com/ubuntu-ports/"}
fi
COMPONENTS="main restricted universe multiverse"
OTHERMIRROR="$OTHERMIRROR | deb $MIRRORSITE $DIST-updates main restricted universe multiverse"
OTHERMIRROR="$OTHERMIRROR | deb $MIRRORSITE $DIST-security main restricted universe multiverse"
OTHERMIRROR="$OTHERMIRROR | deb $MIRRORSITE $DIST-proposed main restricted universe multiverse"
case "$DIST" in
"trusty" | "xenial" )
OTHERMIRROR="$OTHERMIRROR | deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/$OSNAME $DIST main"
ALLOWUNTRUSTED=yes
;;
esac
# deb http://apt.llvm.org/zesty/ llvm-toolchain-zesty-5.0 main
else
echo "Unknown distribution: $DIST"
exit 1
fi
echo "using $NAME $OSNAME $DIST $ARCH $LOGNAME $MIRRORSITE"
case "$DIST" in
"trusty")
# ccache broken
;;
*)
CCACHEDIR=${SET_CCACHEDIR:="/var/cache/pbuilder/ccache"}
;;
esac
# old systems with default gcc <= 6
case "$DIST" in
"trusty" | "xenial" | "stable" )
export DEB_CC=gcc-7
export DEB_CXX=g++-7
;;
esac
if [ "$ARCH" != arm64 ]; then
case "$DIST" in
"experimental")
EXTRAPACKAGES+=" liblld-8-dev libclang-8-dev llvm-8-dev liblld-8 "
export CMAKE_FLAGS="-DLLVM_VERSION_POSTFIX=-8 $CMAKE_FLAGS"
;;
"cosmic" | "testing" | "unstable")
EXTRAPACKAGES+=" liblld-7-dev libclang-7-dev llvm-7-dev liblld-7 "
export CMAKE_FLAGS="-DLLVM_VERSION_POSTFIX=-7 $CMAKE_FLAGS"
;;
"bionic")
EXTRAPACKAGES+=" liblld-6.0-dev libclang-6.0-dev liblld-6.0 "
export CMAKE_FLAGS="-DLLVM_VERSION_POSTFIX=-6.0 $CMAKE_FLAGS"
;;
"artful" )
EXTRAPACKAGES+=" liblld-5.0-dev libclang-5.0-dev liblld-5.0 "
;;
esac
else
export CMAKE_FLAGS="-DENABLE_EMBEDDED_COMPILER=0 $CMAKE_FLAGS"
fi
# Will test symbols
#EXTRAPACKAGES+=" gdb "
# For killall in pbuilder-hooks:
EXTRAPACKAGES+=" psmisc "
[[ $CCACHE_PREFIX == 'distcc' ]] && EXTRAPACKAGES+=" $CCACHE_PREFIX " && USENETWORK=yes && export DISTCC_DIR=/var/cache/pbuilder/distcc
export DEB_BUILD_OPTIONS=parallel=`nproc`
# Floating bug with permissions:
[ -n "$CCACHEDIR" ] && sudo mkdir -p $CCACHEDIR
[ -n "$CCACHEDIR" ] && sudo chmod -R a+rwx $CCACHEDIR || true
# chown -R $BUILDUSERID:$BUILDUSERID $CCACHEDIR
# Do not create source package inside pbuilder (-b)
# Use current dir to make package (by default should have src archive)
# echo "3.0 (native)" > debian/source/format
# OR
# pdebuild -b --debbuildopts "--source-option=--format=\"3.0 (native)\""
# OR
DEBBUILDOPTS="-b --source-option=--format=\"3.0 (native)\""
HOOKDIR="debian/pbuilder-hooks"
#echo "DEBOOTSTRAPOPTS=${DEBOOTSTRAPOPTS[@]}"
#echo "ALLOWUNTRUSTED=${ALLOWUNTRUSTED} OTHERMIRROR=${OTHERMIRROR}"
#echo "EXTRAPACKAGES=${EXTRAPACKAGES}"
This package was created mainly to give users ability easy install and try
ClickHouse DBMS.
If you need support from upstream developers, lack some functionality upstream
has or need low latency and high throughput from CH server then you should
consider installing upstream version from .deb provided on the official site
(https://clickhouse.yandex).
That package is hardly hand-tuned and optimized for production use, but this
one isn't.
This sources was obtained from upstream github and then repacked.
Most vendored libs was removed (to reduce space and fix some possible issues
with buildscripts using files (e.g. headers) from contrib dir even when
system ones exists.
libbtrie and murmurhash was left in contrib since they are not really separate
libs but a small part of bigger projects not intented to be packed into Debian
archive (libbtrie is demo realization and murmuhash is part of hash benchmark
project).
cityhash102 is the copy of Google's cityhash project version 1.0.2. We could not
pack and use debianized CityHash library, because ClickHouse strictly need this
particular version of cityhash algorithm, not the latest upstream (which uses
incompatible hash function).
We also remove website and docs/tools/mkdocs-material-theme, because they
contain some generated files (JS, CSS, images) without sources or files under
trademark protection).
website and docs/tools/mkdocs-material-theme was removed because is contains
many generated files (JS, CSS, images) without sources and files which are
non-free or under trademark protection.
* Clean room rewrite of postrm
* Split config in parts (have to deal with config changes between releases, may be add some tool for this?).
* Add minimal install-time configuration:
+ User/password setup
* Ask before purging database (as mariadb do)
clickhouse (18.16.1) unstable; urgency=low
clickhouse (18.16.1+ds-2) unstable; urgency=medium
* Modified source code
* d/control: Use libcpuinfo only when avaible.
* d/control: Limit build with 64-bit platforms only.
* d/clickhouse-server.postrm: Remove logfiles on purge (Closes: #920831).
* d/clickhouse-server.postrm: Remove database on purge.
* d/control: clickhouse-server recommends clickhouse-client.
* Add 0014-Set-default-umask-to-027.patch.
* Add debian/TODO.
-- <root@yandex-team.ru> Thu, 20 Dec 2018 19:38:50 +0300
-- Alexander GQ Gerasiov <gq@debian.org> Thu, 31 Jan 2019 12:02:02 +0300
clickhouse (18.16.1+ds-1) unstable; urgency=medium
* Initial release (Closes: #851574)
-- Alexander GQ Gerasiov <gq@debian.org> Mon, 21 Jan 2019 01:12:52 +0300
clickhouse (@VERSION_STRING@) unstable; urgency=low
* Modified source code
-- @AUTHOR@ <@EMAIL@> @DATE@
usr/bin/clickhouse-client
usr/bin/clickhouse-local
usr/bin/clickhouse-compressor
usr/bin/clickhouse-benchmark
usr/bin/clickhouse-format
etc/clickhouse-client/config.xml
usr/bin/clickhouse-extract-from-config
#!/bin/sh
set -e
CLICKHOUSE_USER=${CLICKHOUSE_USER=clickhouse}
mkdir -p /etc/clickhouse-client/conf.d
usr/bin/clickhouse
etc/security/limits.d/clickhouse.conf
usr/share/clickhouse/*
usr/bin/clickhouse
usr/bin/clickhouse-server
usr/bin/clickhouse-clang
usr/bin/clickhouse-lld
usr/bin/clickhouse-copier
usr/bin/clickhouse-odbc-bridge
usr/bin/clickhouse-report
etc/systemd/system/clickhouse-server.service
etc/init.d/clickhouse-server
etc/cron.d/clickhouse-server
usr/share/clickhouse/*
etc/security/limits.d/clickhouse.conf
clickhouse-server.postinst
\ No newline at end of file
clickhouse-server.preinst
\ No newline at end of file
clickhouse-server.prerm
\ No newline at end of file
clickhouse-server.service
\ No newline at end of file
etc/clickhouse-server/config.xml etc/clickhouse-server
etc/clickhouse-server/users.xml etc/clickhouse-server
usr/bin/clickhouse usr/bin/clickhouse-server
#*/10 * * * * root (which service > /dev/null 2>&1 && (service clickhouse-server condstart ||:)) || /etc/init.d/clickhouse-server condstart > /dev/null 2>&1
This diff is collapsed.
usr/bin/clickhouse-server
usr/bin/clickhouse-clang
usr/bin/clickhouse-lld
usr/bin/clickhouse-copier
usr/bin/clickhouse-odbc-bridge
usr/bin/clickhouse-report
usr/bin/clickhouse-server usr/sbin
etc/clickhouse-server/config.xml
etc/clickhouse-server/users.xml
etc/systemd/system/clickhouse-server.service
#!/bin/sh
set -e
CLICKHOUSE_USER=${CLICKHOUSE_USER=clickhouse}
CLICKHOUSE_GROUP=${CLICKHOUSE_GROUP=${CLICKHOUSE_USER}}
CLICKHOUSE_CONFDIR=${CLICKHOUSE_CONFDIR=/etc/clickhouse-server}
CLICKHOUSE_DATADIR=${CLICKHOUSE_DATADIR=/var/lib/clickhouse}
CLICKHOUSE_LOGDIR=${CLICKHOUSE_LOGDIR=/var/log/clickhouse-server}
CLICKHOUSE_BINDIR=${CLICKHOUSE_BINDIR=/usr/bin}
CLICKHOUSE_GENERIC_PROGRAM=${CLICKHOUSE_GENERIC_PROGRAM=clickhouse}
OS=${OS=`lsb_release -is 2>/dev/null || uname -s ||:`}
test -f /etc/default/clickhouse && . /etc/default/clickhouse
if [ "$1" = configure ]; then
if [ -x "/bin/systemctl" ] && [ -f /etc/systemd/system/clickhouse-server.service ] && [ -d /run/systemd/system ]; then
# if old rc.d service present - remove it
if [ -x "/etc/init.d/clickhouse-server" ]; then
update-rc.d clickhouse-server remove
echo "ClickHouse init script has migrated to systemd. Please manually stop old server and restart the service: sudo killall clickhouse-server && sleep 5 && sudo service clickhouse-server restart"
fi
/bin/systemctl daemon-reload
/bin/systemctl enable clickhouse-server
else
# If you downgrading to version older than 1.1.54336 run: systemctl disable clickhouse-server
if [ -x "/etc/init.d/clickhouse-server" ]; then
if [ "$OS" = "rhel" ] || [ "$OS" = "centos" ] || [ "$OS" = "fedora" ]; then
echo # TODO
else
update-rc.d clickhouse-server defaults 19 19 >/dev/null || exit $?
fi
fi
fi
# Make sure the administrative user exists
if ! getent passwd ${CLICKHOUSE_USER} > /dev/null; then
if [ "$OS" = "rhel" ] || [ "$OS" = "centos" ] || [ "$OS" = "fedora" ]; then
adduser --system --no-create-home --home /nonexistent \
--shell /bin/false ${CLICKHOUSE_USER} > /dev/null
else
adduser --system --disabled-login --no-create-home --home /nonexistent \
--shell /bin/false --group --gecos "ClickHouse server" ${CLICKHOUSE_USER} > /dev/null
fi
fi
# if the user was created manually, make sure the group is there as well
if ! getent group ${CLICKHOUSE_GROUP} > /dev/null; then
addgroup --system ${CLICKHOUSE_GROUP} > /dev/null
fi
# postinst script for clickhouse-server
#
# see: dh_installdeb(1)
# make sure user is in the correct group
if ! id -Gn ${CLICKHOUSE_USER} | grep -qw ${CLICKHOUSE_USER}; then
adduser ${CLICKHOUSE_USER} ${CLICKHOUSE_GROUP} > /dev/null
fi
# check validity of user and group
if [ "`id -u ${CLICKHOUSE_USER}`" -eq 0 ]; then
echo "The ${CLICKHOUSE_USER} system user must not have uid 0 (root).
Please fix this and reinstall this package." >&2
exit 1
fi
set -e
if [ "`id -g ${CLICKHOUSE_GROUP}`" -eq 0 ]; then
echo "The ${CLICKHOUSE_USER} system user must not have root as primary group.
Please fix this and reinstall this package." >&2
# summary of how this script can be called:
# * <postinst> `configure' <most-recently-configured-version>
# * <old-postinst> `abort-upgrade' <new version>
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
# <new-version>
# * <postinst> `abort-remove'
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
# <failed-install-package> <version> `removing'
# <conflicting-package> <version>
# for details, see https://www.debian.org/doc/debian-policy/ or
# the debian-policy package
USER=clickhouse
case "$1" in
configure)
adduser --disabled-password --quiet --system \
--home /var/lib/clickhouse \
--gecos "ClickHouse daemon" --group $USER
mkdir -p /var/log/clickhouse-server
chown $USER:$USER /var/log/clickhouse-server
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
fi
if [ ! -d ${CLICKHOUSE_DATADIR} ]; then
mkdir -p ${CLICKHOUSE_DATADIR}
chown ${CLICKHOUSE_USER}:${CLICKHOUSE_GROUP} ${CLICKHOUSE_DATADIR}
chmod 700 ${CLICKHOUSE_DATADIR}
fi
if [ -d ${CLICKHOUSE_CONFDIR} ]; then
rm -v ${CLICKHOUSE_CONFDIR}/*-preprocessed.xml ||:
fi
ln -s ${CLICKHOUSE_DATADIR}/preprocessed_configs ${CLICKHOUSE_CONFDIR}/preprocessed ||:
if [ ! -d ${CLICKHOUSE_LOGDIR} ]; then
mkdir -p ${CLICKHOUSE_LOGDIR}
chown root:${CLICKHOUSE_GROUP} ${CLICKHOUSE_LOGDIR}
# Allow everyone to read logs, root and clickhouse to read-write
chmod 775 ${CLICKHOUSE_LOGDIR}
fi
;;
esac
# Set net_admin capabilities to support introspection of "taskstats" performance metrics from the kernel.
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
command -v setcap >/dev/null \
&& setcap "cap_net_admin=+ep cap_ipc_lock=+ep" "${CLICKHOUSE_BINDIR}/${CLICKHOUSE_GENERIC_PROGRAM}" \
|| echo "Cannot set 'net_admin' or 'ipc_lock' capability for clickhouse binary. This is optional. Taskstats accounting will be disabled. To enable taskstats accounting you may add the required capability later manually."
#DEBHELPER#
# Clean old dynamic compilation results
if [ -d "${CLICKHOUSE_DATADIR}/build" ]; then
rm -f ${CLICKHOUSE_DATADIR}/build/*.cpp ${CLICKHOUSE_DATADIR}/build/*.so ||:
fi
fi
exit 0
#!/bin/sh
# postrm script for clickhouse-server
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <postrm> `remove'
# * <postrm> `purge'
# * <old-postrm> `upgrade' <new-version>
# * <new-postrm> `failed-upgrade' <old-version>
# * <new-postrm> `abort-install'
# * <new-postrm> `abort-install' <old-version>
# * <new-postrm> `abort-upgrade' <old-version>
# * <disappearer's-postrm> `disappear' <overwriter>
# <overwriter-version>
# for details, see https://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
purge)
rm -rf /var/log/clickhouse-server/ || true
# Idea from mariadb-server, see #829491
if [ -d /var/lib/clickhouse ];then
find /var/lib/clickhouse -not -path /var/lib/clickhouse/lost+found -delete || true
fi
;;
remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
;;
*)
echo "postrm called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0
#!/bin/sh
if [ "$1" = "upgrade" ]; then
# Return etc/cron.d/clickhouse-server to original state
service clickhouse-server disable_cron ||:
fi
#!/bin/sh
if [ "$1" = "upgrade" ] || [ "$1" = "remove" ]; then
# Return etc/cron.d/clickhouse-server to original state
service clickhouse-server disable_cron ||:
fi
[Unit]
Description=ClickHouse Server (analytic DBMS for big data)
Description=ClickHouse Server
After=network.target
[Service]
Type=simple
User=clickhouse
Group=clickhouse
PermissionsStartOnly=true
Restart=always
RestartSec=30
ExecStart=/usr/bin/clickhouse-server --config=/etc/clickhouse-server/config.xml
LimitCORE=infinity
LimitNOFILE=500000
CapabilityBoundingSet=CAP_NET_ADMIN CAP_IPC_LOCK
ExecStart=/usr/sbin/clickhouse-server --config=/etc/clickhouse-server/config.xml
[Install]
WantedBy=multi-user.target
usr/bin/clickhouse-test
usr/bin/clickhouse-test-server
usr/bin/clickhouse-performance-test
usr/share/clickhouse-test/*
etc/clickhouse-client/client-test.xml
etc/clickhouse-server/server-test.xml
usr/bin/clickhouse-benchmark
usr/bin/clickhouse-compressor
usr/bin/clickhouse-copier
usr/bin/clickhouse-performance-test
usr/bin/clickhouse-format
clickhouse soft nofile 262144
clickhouse hard nofile 262144
Source: clickhouse
Section: database
Priority: optional
Maintainer: Alexey Milovidov <milovidov@yandex-team.ru>
Build-Depends: debhelper (>= 9),
cmake3 | cmake,
ninja-build,
gcc-7 [amd64 i386] | gcc-8 [amd64 i386], g++-7 [amd64 i386] | g++-8 [amd64 i386],
clang-6.0 [arm64 armhf] | clang-5.0 [arm64 armhf] | clang-7 [arm64 armhf],
libc6-dev,
Maintainer: Alexander GQ Gerasiov <gq@debian.org>
Build-Depends: cmake,
curl <!nocheck>,
debhelper (>= 10),
default-libmysqlclient-dev | libmysqlclient-dev,
gdb <!nocheck>,
googletest,
libboost-dev,
libboost-filesystem-dev,
libboost-program-options-dev,
libboost-regex-dev,
libboost-system-dev,
libboost-thread-dev,
libcapnp-dev,
libcctz-dev,
libcpuinfo-dev [amd64 arm64],
libdouble-conversion-dev,
libfarmhash-dev,
libglib2.0-dev,
libgoogle-perftools-dev,
libgsasl7-dev,
libicu-dev,
libreadline-dev
Standards-Version: 3.9.8
libjemalloc-dev,
libltdl-dev,
liblz4-dev,
libpoco-dev,
librdkafka-dev,
libre2-dev,
libreadline-dev,
libsparsehash-dev,
libssl-dev,
libzstd-dev,
llvm-dev,
openssl <!nocheck>,
python-lxml <!nocheck>,
python-requests <!nocheck>,
python-termcolor <!nocheck>,
unixodbc-dev,
zlib1g-dev,
libdivide-dev,
libpcg-cpp-dev,
libmetrohash-dev,
# libclang-dev,
# liblld-7-dev,
#needs newer version
# libunwind-dev (>= 1.3),
Standards-Version: 4.3.0
Homepage: https://clickhouse.yandex/
Vcs-Git: https://salsa.debian.org/debian/ClickHouse.git
Vcs-Browser: https://salsa.debian.org/debian/ClickHouse
Package: clickhouse-client
Architecture: all
Depends: ${shlibs:Depends}, ${misc:Depends}, clickhouse-common-static (= ${binary:Version}) | clickhouse-server-base (= ${binary:Version})
Replaces: clickhouse-compressor
Conflicts: clickhouse-compressor
Description: Client binary for ClickHouse
Yandex ClickHouse is a column-oriented database management system
that allows generating analytical data reports in real time.
.
This package provides clickhouse-client , clickhouse-local and clickhouse-benchmark
Package: clickhouse-common-static
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, tzdata
Replaces: clickhouse-server-base
Provides: clickhouse-server-base
Description: Common files for ClickHouse
Yandex ClickHouse is a column-oriented database management system
that allows generating analytical data reports in real time.
Package: clickhouse-common
Architecture: any-amd64 ia64 arm64 ppc64el ppc64 s390x mips64el sparc64 riscv64
Depends: ${misc:Depends}, ${shlibs:Depends}
Description: column-oriented database system (common files)
ClickHouse is a column-oriented database management system that allows
generating analytical data reports in real time.
.
This package provides common files for both clickhouse server and client
This package provides common files for both ClickHouse server and client.
Package: clickhouse-server
Architecture: all
Depends: ${shlibs:Depends}, ${misc:Depends}, clickhouse-common-static (= ${binary:Version}), adduser
Replaces: clickhouse-server-common, clickhouse-server-base
Provides: clickhouse-server-common
Description: Server binary for ClickHouse
Yandex ClickHouse is a column-oriented database management system
that allows generating analytical data reports in real time.
Architecture: any-amd64 ia64 arm64 ppc64el ppc64 s390x mips64el sparc64 riscv64
Depends: ${misc:Depends}, ${shlibs:Depends}, clickhouse-common (= ${binary:Version}), adduser
Recommends: clickhouse-client (= ${binary:Version})
Description: column-oriented database system (server runner)
ClickHouse is a column-oriented database management system that allows
generating analytical data reports in real time.
.
This package provides clickhouse common configuration files
Package: clickhouse-common-static-dbg
Architecture: any
Section: debug
Priority: optional
Depends: ${misc:Depends}
Replaces: clickhouse-common-dbg
Conflicts: clickhouse-common-dbg
Description: debugging symbols for clickhouse-common-static
This package contains the debugging symbols for clickhouse-common.
Package: clickhouse-test
Priority: optional
Architecture: all
Depends: ${shlibs:Depends}, ${misc:Depends}, clickhouse-client, bash, expect, python, python-lxml, python-termcolor, python-requests, curl, perl, sudo, openssl, netcat-openbsd, telnet
Description: ClickHouse tests
This package provides ClickHouse server runner.
Package: clickhouse-client
Architecture: any-amd64 ia64 arm64 ppc64el ppc64 s390x mips64el sparc64 riscv64
Depends: ${misc:Depends}, ${shlibs:Depends}, clickhouse-common (= ${binary:Version})
Description: column-oriented database system (cli client)
ClickHouse is a column-oriented database management system that allows
generating analytical data reports in real time.
.
This package provides ClickHouse CLI client.
# TODO: Remove:
Package: clickhouse-server-base
Architecture: any
Priority: optional
Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, tzdata
Description: DEPRECATED PACKAGE (use clickhouse-common-static): Server binary for clickhouse
Package: clickhouse-server-common
Architecture: all
Priority: optional
Depends: ${shlibs:Depends}, ${misc:Depends}, clickhouse-server-base (= ${binary:Version})
Description: DEPRECATED PACKAGE (use clickhouse-server): Common configuration files for clickhouse-server-base package
Package: clickhouse-tools
Architecture: any-amd64 ia64 arm64 ppc64el ppc64 s390x mips64el sparc64 riscv64
Depends: ${misc:Depends}, ${shlibs:Depends}, clickhouse-common (= ${binary:Version})
Description: column-oriented database system (tools)
ClickHouse is a column-oriented database management system that allows
generating analytical data reports in real time.
.
This package provides various ClickHouse tools:
- clickhouse-performance-test
- clickhouse-benchmark
- clickhouse-compressor
- clickhouse-copier
and some others.
This diff is collapsed.
package config;
$default_host = "metrika";
$cfg{'metrika'} = {
fqdn => "",
method => "scpb",
incoming => "/repo/metrika/mini-dinstall/incoming/",
dinstall_runs => 0,
login => "@AUTHOR@"
};
[DEFAULT]
pristine-tar = True
compression=xz
From: Alexander GQ Gerasiov <gq@cs.msu.su>
Date: Wed, 16 Jan 2019 01:39:01 +0300
Subject: Enable link time optimization (-flto).
This reduce target's size by 30%.
Signed-off-by: Alexander GQ Gerasiov <gq@cs.msu.su>
---
CMakeLists.txt | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 11bc21e..b172d2f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,8 +1,23 @@
project (ClickHouse)
-cmake_minimum_required (VERSION 3.3)
+cmake_minimum_required (VERSION 3.9)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/")
+set(ENABLE_IPO OFF CACHE STRING "Enable inter-procedural optimization (aka LTO)")
+
+if (ENABLE_IPO)
+include(CheckIPOSupported)
+check_ipo_supported(RESULT IPO_SUPPORTED OUTPUT IPO_NOT_SUPPORTED)
+if(IPO_SUPPORTED)
+ message(STATUS "IPO/LTO is supported, enabling")
+ set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
+else()
+ message(STATUS "IPO/LTO is not supported: <${IPO_NOT_SUPPORTED}>")
+endif()
+else()
+ message(STATUS "IPO/LTO not enabled.")
+endif()
+
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# Require at least gcc 7
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7 AND NOT CMAKE_VERSION VERSION_LESS 2.8.9)
From: Alexander GQ Gerasiov <gq@cs.msu.su>
Date: Wed, 16 Jan 2019 00:13:13 +0300
Subject: Remove non-determinism.
Signed-off-by: Alexander GQ Gerasiov <gq@cs.msu.su>
---
dbms/src/Storages/System/StorageSystemBuildOptions.generated.cpp.in | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/dbms/src/Storages/System/StorageSystemBuildOptions.generated.cpp.in b/dbms/src/Storages/System/StorageSystemBuildOptions.generated.cpp.in
index 5c72545..99f0135 100644
--- a/dbms/src/Storages/System/StorageSystemBuildOptions.generated.cpp.in
+++ b/dbms/src/Storages/System/StorageSystemBuildOptions.generated.cpp.in
@@ -4,12 +4,9 @@ const char * auto_config_build[]
{
"VERSION_FULL", "@VERSION_FULL@",
"VERSION_DESCRIBE", "@VERSION_DESCRIBE@",
- "VERSION_GITHASH", "@VERSION_GITHASH@",
- "VERSION_REVISION", "@VERSION_REVISION@",
"VERSION_INTEGER", "@VERSION_INTEGER@",
- "BUILD_DATE", "@BUILD_DATE@",
"BUILD_TYPE", "@CMAKE_BUILD_TYPE@",
- "SYSTEM", "@CMAKE_SYSTEM@",
+ "SYSTEM", "@CMAKE_SYSTEM_NAME@",
"SYSTEM_PROCESSOR", "@CMAKE_SYSTEM_PROCESSOR@",
"LIBRARY_ARCHITECTURE", "@CMAKE_LIBRARY_ARCHITECTURE@",
"CMAKE_VERSION", "@CMAKE_VERSION@",
From: Alexander GQ Gerasiov <gq@cs.msu.su>
Date: Tue, 25 Dec 2018 23:44:10 +0300
Subject: Fix FTBFS with gcc because of -Wno-format
---
contrib/CMakeLists.txt | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/contrib/CMakeLists.txt b/contrib/CMakeLists.txt
index 6617332..ac496a1 100644
--- a/contrib/CMakeLists.txt
+++ b/contrib/CMakeLists.txt
@@ -1,11 +1,11 @@
# Third-party libraries may have substandard code.
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
- set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-function -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-result -Wno-deprecated-declarations -Wno-maybe-uninitialized -Wno-format -Wno-misleading-indentation -Wno-stringop-overflow")
- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-old-style-cast -Wno-unused-function -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-result -Wno-deprecated-declarations -Wno-non-virtual-dtor -Wno-maybe-uninitialized -Wno-format -Wno-misleading-indentation -Wno-implicit-fallthrough -Wno-class-memaccess -std=c++1z")
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-function -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-result -Wno-deprecated-declarations -Wno-maybe-uninitialized -Wno-misleading-indentation -Wno-stringop-overflow")
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-old-style-cast -Wno-unused-function -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-result -Wno-deprecated-declarations -Wno-non-virtual-dtor -Wno-maybe-uninitialized -Wno-misleading-indentation -Wno-implicit-fallthrough -Wno-class-memaccess -std=c++1z")
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
- set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-function -Wno-unused-variable -Wno-unused-result -Wno-deprecated-declarations -Wno-format -Wno-parentheses-equality")
- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-old-style-cast -Wno-unused-function -Wno-unused-variable -Wno-unused-result -Wno-deprecated-declarations -Wno-non-virtual-dtor -Wno-format -std=c++1z")
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-function -Wno-unused-variable -Wno-unused-result -Wno-deprecated-declarations -Wno-parentheses-equality")
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-old-style-cast -Wno-unused-function -Wno-unused-variable -Wno-unused-result -Wno-deprecated-declarations -Wno-non-virtual-dtor -std=c++1z")
endif ()
if (USE_INTERNAL_BOOST_LIBRARY)
From: Alexander GQ Gerasiov <gq@cs.msu.su>
Date: Wed, 9 Jan 2019 01:25:53 +0300
Subject: Disable optimization for build host.
---
CMakeLists.txt | 2 --
1 file changed, 2 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b172d2f..d5c5363 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -140,8 +140,6 @@ if (PIPE)
set (COMPILER_FLAGS "${COMPILER_FLAGS} -pipe")
endif ()
-include (cmake/test_cpu.cmake)
-
if(NOT COMPILER_CLANG) # clang: error: the clang compiler does not support '-march=native'
option(ARCH_NATIVE "Enable -march=native compiler flag" ${ARCH_ARM})
endif()
From: Alexander GQ Gerasiov <gq@cs.msu.su>
Date: Wed, 26 Dec 2018 23:22:09 +0300
Subject: Use system installed googletest.
Since googletest 3.5 or 3.6 in Debian it is installed as source into
/usr/src/googletest to allow build with user's compiler.
So we just need to build it from the directory the same way we build
bundled one.
---
cmake/find_gtest.cmake | 8 +-------
contrib/CMakeLists.txt | 3 +++
2 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/cmake/find_gtest.cmake b/cmake/find_gtest.cmake
index ce0a3d3..514f558 100644
--- a/cmake/find_gtest.cmake
+++ b/cmake/find_gtest.cmake
@@ -9,12 +9,6 @@ if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/googletest/googletest/CMakeList
endif ()
if (NOT USE_INTERNAL_GTEST_LIBRARY)
- find_package (GTest)
-endif ()
-
-if (NOT GTEST_INCLUDE_DIRS AND NOT MISSING_INTERNAL_GTEST_LIBRARY)
- set (USE_INTERNAL_GTEST_LIBRARY 1)
+ set (GTEST_SRC_DIR "/usr/src/googletest")
set (GTEST_MAIN_LIBRARIES gtest_main)
endif ()
-
-message (STATUS "Using gtest: ${GTEST_INCLUDE_DIRS} : ${GTEST_MAIN_LIBRARIES}")
diff --git a/contrib/CMakeLists.txt b/contrib/CMakeLists.txt
index ac496a1..ab453b9 100644
--- a/contrib/CMakeLists.txt
+++ b/contrib/CMakeLists.txt
@@ -166,6 +166,9 @@ if (USE_INTERNAL_GTEST_LIBRARY)
# avoid problems with <regexp.h>
target_compile_definitions (gtest INTERFACE GTEST_HAS_POSIX_RE=0)
target_include_directories (gtest SYSTEM INTERFACE ${ClickHouse_SOURCE_DIR}/contrib/googletest/include)
+else ()
+ add_subdirectory(${GTEST_SRC_DIR}/googletest ${CMAKE_CURRENT_BINARY_DIR}/googletest)
+ target_compile_definitions (gtest INTERFACE GTEST_HAS_POSIX_RE=0)
endif ()
if (USE_INTERNAL_LLVM_LIBRARY)
From: Alexander GQ Gerasiov <gq@cs.msu.su>
Date: Thu, 27 Dec 2018 01:09:48 +0300
Subject: Disable unwind
CH uses unreleaser libunwind API, so disable it until it would be released
and uploaded into the archive.
---
CMakeLists.txt | 1 -
1 file changed, 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d5c5363..546e488 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -311,7 +311,6 @@ include (libs/libcommon/cmake/find_gperftools.cmake)
include (libs/libcommon/cmake/find_jemalloc.cmake)
include (libs/libcommon/cmake/find_cctz.cmake)
include (libs/libmysqlxx/cmake/find_mysqlclient.cmake)
-include (libs/libdaemon/cmake/find_unwind.cmake)
include (cmake/print_flags.cmake)
From: Alexander GQ Gerasiov <gq@cs.msu.su>
Date: Sat, 29 Dec 2018 21:45:56 +0300
Subject: Disable base64 usage (not available in Debian yet).
---
CMakeLists.txt | 1 -
1 file changed, 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 546e488..17a56da 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -294,7 +294,6 @@ include (cmake/find_libgsasl.cmake)
include (cmake/find_libxml2.cmake)
include (cmake/find_hdfs3.cmake)
include (cmake/find_consistent-hashing.cmake)
-include (cmake/find_base64.cmake)
if (ENABLE_TESTS)
include (cmake/find_gtest.cmake)
endif ()
From: Alexander GQ Gerasiov <gq@cs.msu.su>
Date: Fri, 4 Jan 2019 03:04:07 +0300
Subject: Replace cpuid with cpuinfo.
cpuinfo is already shipped in Debian and provides more suitable API.
This commit is not enough for inclusion into upstream codebase. One also
needs to replace cpuid with cpuinfo in the "contrib" directory.
Signed-off-by: Alexander GQ Gerasiov <gq@cs.msu.su>
---
CMakeLists.txt | 2 +-
cmake/find_cpuid.cmake | 29 -------------
cmake/find_cpuinfo.cmake | 16 ++++++++
contrib/CMakeLists.txt | 4 --
dbms/CMakeLists.txt | 13 +++---
dbms/src/Common/config.h.in | 1 +
dbms/src/Common/getNumberOfPhysicalCPUCores.cpp | 54 ++++++++-----------------
7 files changed, 43 insertions(+), 76 deletions(-)
delete mode 100644 cmake/find_cpuid.cmake
create mode 100644 cmake/find_cpuinfo.cmake
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 17a56da..549b6e9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -289,7 +289,7 @@ include (cmake/find_re2.cmake)
include (cmake/find_rdkafka.cmake)
include (cmake/find_capnp.cmake)
include (cmake/find_llvm.cmake)
-include (cmake/find_cpuid.cmake)
+include (cmake/find_cpuinfo.cmake)
include (cmake/find_libgsasl.cmake)
include (cmake/find_libxml2.cmake)
include (cmake/find_hdfs3.cmake)
diff --git a/cmake/find_cpuid.cmake b/cmake/find_cpuid.cmake
deleted file mode 100644
index cda8843..0000000
--- a/cmake/find_cpuid.cmake
+++ /dev/null
@@ -1,29 +0,0 @@
-if (NOT ARCH_ARM)
- option (USE_INTERNAL_CPUID_LIBRARY "Set to FALSE to use system cpuid library instead of bundled" ${NOT_UNBUNDLED})
-endif ()
-
-#if (USE_INTERNAL_CPUID_LIBRARY AND NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/libcpuid/include/cpuid/libcpuid.h")
-# message (WARNING "submodule contrib/libcpuid is missing. to fix try run: \n git submodule update --init --recursive")
-# set (USE_INTERNAL_CPUID_LIBRARY 0)
-# set (MISSING_INTERNAL_CPUID_LIBRARY 1)
-#endif ()
-
-if (NOT USE_INTERNAL_CPUID_LIBRARY)
- find_library (CPUID_LIBRARY cpuid)
- find_path (CPUID_INCLUDE_DIR NAMES libcpuid/libcpuid.h PATHS ${CPUID_INCLUDE_PATHS})
-endif ()
-
-if (CPUID_LIBRARY AND CPUID_INCLUDE_DIR)
- if (OS_FREEBSD)
- # need in /usr/local/include/libcpuid/libcpuid_types.h
- # Freebsd: /usr/local/include/libcpuid/libcpuid_types.h:61:29: error: conflicting declaration 'typedef long long int int64_t'
- add_definitions(-DHAVE_STDINT_H)
- # TODO: make virtual target cpuid:cpuid with COMPILE_DEFINITIONS property
- endif ()
-elseif (NOT MISSING_INTERNAL_CPUID_LIBRARY)
- set (CPUID_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/contrib/libcpuid/include)
- set (USE_INTERNAL_CPUID_LIBRARY 1)
- set (CPUID_LIBRARY cpuid)
-endif ()
-
-message (STATUS "Using cpuid: ${CPUID_INCLUDE_DIR} : ${CPUID_LIBRARY}")
diff --git a/cmake/find_cpuinfo.cmake b/cmake/find_cpuinfo.cmake
new file mode 100644
index 0000000..959119f
--- /dev/null
+++ b/cmake/find_cpuinfo.cmake
@@ -0,0 +1,16 @@
+if (NOT ARCH_ARM)
+ option (USE_INTERNAL_CPUINFO_LIBRARY "Set to FALSE to use system cpuinfo library instead of bundled" ${NOT_UNBUNDLED})
+endif ()
+
+if (NOT USE_INTERNAL_CPUINFO_LIBRARY)
+ find_library (CPUINFO_LIBRARY cpuinfo)
+ find_path (CPUINFO_INCLUDE_DIR NAMES cpuinfo.h PATHS ${CPUINFO_INCLUDE_PATHS})
+endif ()
+
+if (CPUINFO_LIBRARY)
+ set(USE_CPUINFO 1)
+else()
+ set(USE_CPUINFO 0)
+endif ()
+
+message (STATUS "Using cpuinfo: ${CPUINFO_INCLUDE_DIR} : ${CPUINFO_LIBRARY}")
diff --git a/contrib/CMakeLists.txt b/contrib/CMakeLists.txt
index ab453b9..8941e96 100644
--- a/contrib/CMakeLists.txt
+++ b/contrib/CMakeLists.txt
@@ -97,10 +97,6 @@ if (ENABLE_JEMALLOC AND USE_INTERNAL_JEMALLOC_LIBRARY)
add_subdirectory (jemalloc-cmake)
endif ()
-if (USE_INTERNAL_CPUID_LIBRARY)
- add_subdirectory (libcpuid)
-endif ()
-
if (USE_INTERNAL_SSL_LIBRARY)
if (NOT MAKE_STATIC_LIBRARIES)
set (BUILD_SHARED 1)
diff --git a/dbms/CMakeLists.txt b/dbms/CMakeLists.txt
index b7f1173..0e4a36a 100644
--- a/dbms/CMakeLists.txt
+++ b/dbms/CMakeLists.txt
@@ -142,17 +142,12 @@ if (CMAKE_BUILD_TYPE_UC STREQUAL "RELEASE" OR CMAKE_BUILD_TYPE_UC STREQUAL "RELW
PROPERTIES COMPILE_FLAGS -g0)
endif ()
-if (NOT ARCH_ARM AND CPUID_LIBRARY)
- set (LINK_LIBRARIES_ONLY_ON_X86_64 ${CPUID_LIBRARY})
-endif()
-
target_link_libraries (clickhouse_common_io
PUBLIC
common
PRIVATE
string_utils
widechar_width
- ${LINK_LIBRARIES_ONLY_ON_X86_64}
${LZ4_LIBRARY}
${ZSTD_LIBRARY}
${DOUBLE_CONVERSION_LIBRARIES}
@@ -175,6 +170,14 @@ target_link_libraries (clickhouse_common_io
${CMAKE_DL_LIBS}
)
+if (USE_CPUINFO)
+target_link_libraries (clickhouse_common_io
+ PRIVATE
+ ${CPUINFO_LIBRARY}
+)
+endif ()
+
+
target_link_libraries (dbms
PRIVATE
clickhouse_parsers
diff --git a/dbms/src/Common/config.h.in b/dbms/src/Common/config.h.in
index 302fc33..157a2d6 100644
--- a/dbms/src/Common/config.h.in
+++ b/dbms/src/Common/config.h.in
@@ -17,3 +17,4 @@
#cmakedefine01 CLICKHOUSE_SPLIT_BINARY
#cmakedefine01 USE_BASE64
#cmakedefine01 USE_HDFS
+#cmakedefine01 USE_CPUINFO
diff --git a/dbms/src/Common/getNumberOfPhysicalCPUCores.cpp b/dbms/src/Common/getNumberOfPhysicalCPUCores.cpp
index 0a686b9..9832574 100644
--- a/dbms/src/Common/getNumberOfPhysicalCPUCores.cpp
+++ b/dbms/src/Common/getNumberOfPhysicalCPUCores.cpp
@@ -1,45 +1,25 @@
#include <Common/getNumberOfPhysicalCPUCores.h>
#include <thread>
-#if defined(__x86_64__)
-
- #include <libcpuid/libcpuid.h>
- #include <Common/Exception.h>
-
- namespace DB { namespace ErrorCodes { extern const int CPUID_ERROR; }}
-
-#endif
+#include <Common/config.h>
+#if USE_CPUINFO
+#include <cpuinfo.h>
unsigned getNumberOfPhysicalCPUCores()
{
-#if defined(__x86_64__)
- cpu_raw_data_t raw_data;
- if (0 != cpuid_get_raw_data(&raw_data))
- throw DB::Exception("Cannot cpuid_get_raw_data: " + std::string(cpuid_error()), DB::ErrorCodes::CPUID_ERROR);
-
- cpu_id_t data;
- if (0 != cpu_identify(&raw_data, &data))
- throw DB::Exception("Cannot cpu_identify: " + std::string(cpuid_error()), DB::ErrorCodes::CPUID_ERROR);
-
- /// On Xen VMs, libcpuid returns wrong info (zero number of cores). Fallback to alternative method.
- if (data.num_logical_cpus == 0)
- return std::thread::hardware_concurrency();
-
- unsigned res = data.num_cores * data.total_logical_cpus / data.num_logical_cpus;
-
- /// Also, libcpuid gives strange result on Google Compute Engine VMs.
- /// Example:
- /// num_cores = 12, /// number of physical cores on current CPU socket
- /// total_logical_cpus = 1, /// total number of logical cores on all sockets
- /// num_logical_cpus = 24. /// number of logical cores on current CPU socket
- /// It means two-way hyper-threading (24 / 12), but contradictory, 'total_logical_cpus' == 1.
-
- if (res != 0)
- return res;
-#endif
-
- /// As a fallback (also for non-x86 architectures) assume there are no hyper-threading on the system.
- /// (Actually, only Aarch64 is supported).
- return std::thread::hardware_concurrency();
+ uint32_t cores = 0;
+ if (cpuinfo_initialize())
+ cores = cpuinfo_get_cores_count();
+
+ if (cores)
+ return cores;
+ else
+ return std::thread::hardware_concurrency();
}
+#else
+unsigned getNumberOfPhysicalCPUCores()
+{
+ return std::thread::hardware_concurrency();
+}
+#endif
From: Alexander GQ Gerasiov <gq@cs.msu.su>
Date: Sat, 5 Jan 2019 21:45:03 +0300
Subject: Fix install of binaries when SPLIT_BINARIES is set.
---
dbms/programs/benchmark/CMakeLists.txt | 1 +
dbms/programs/client/CMakeLists.txt | 1 +
dbms/programs/compressor/CMakeLists.txt | 1 +
dbms/programs/copier/CMakeLists.txt | 1 +
dbms/programs/format/CMakeLists.txt | 1 +
dbms/programs/odbc-bridge/CMakeLists.txt | 1 +
dbms/programs/performance-test/CMakeLists.txt | 1 +
7 files changed, 7 insertions(+)
diff --git a/dbms/programs/benchmark/CMakeLists.txt b/dbms/programs/benchmark/CMakeLists.txt
index af11c60..dc55547 100644
--- a/dbms/programs/benchmark/CMakeLists.txt
+++ b/dbms/programs/benchmark/CMakeLists.txt
@@ -5,4 +5,5 @@ target_include_directories (clickhouse-benchmark-lib SYSTEM PRIVATE ${PCG_RANDOM
if (CLICKHOUSE_SPLIT_BINARY)
add_executable (clickhouse-benchmark clickhouse-benchmark.cpp)
target_link_libraries (clickhouse-benchmark PRIVATE clickhouse-benchmark-lib clickhouse_aggregate_functions)
+ install (TARGETS clickhouse-benchmark ${CLICKHOUSE_ALL_TARGETS} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT clickhouse-benchmark)
endif ()
diff --git a/dbms/programs/client/CMakeLists.txt b/dbms/programs/client/CMakeLists.txt
index f3dd518..7fed7f7 100644
--- a/dbms/programs/client/CMakeLists.txt
+++ b/dbms/programs/client/CMakeLists.txt
@@ -7,6 +7,7 @@ endif ()
if (CLICKHOUSE_SPLIT_BINARY)
add_executable (clickhouse-client clickhouse-client.cpp)
target_link_libraries (clickhouse-client PRIVATE clickhouse-client-lib)
+ install (TARGETS clickhouse-client ${CLICKHOUSE_ALL_TARGETS} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT clickhouse-client)
endif ()
install (FILES clickhouse-client.xml DESTINATION ${CLICKHOUSE_ETC_DIR}/clickhouse-client COMPONENT clickhouse-client RENAME config.xml)
diff --git a/dbms/programs/compressor/CMakeLists.txt b/dbms/programs/compressor/CMakeLists.txt
index 7aa2cad..e904ef2 100644
--- a/dbms/programs/compressor/CMakeLists.txt
+++ b/dbms/programs/compressor/CMakeLists.txt
@@ -5,4 +5,5 @@ if (CLICKHOUSE_SPLIT_BINARY)
# Also in utils
add_executable (clickhouse-compressor clickhouse-compressor.cpp)
target_link_libraries (clickhouse-compressor PRIVATE clickhouse-compressor-lib)
+ install (TARGETS clickhouse-compressor ${CLICKHOUSE_ALL_TARGETS} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT clickhouse-compressor)
endif ()
diff --git a/dbms/programs/copier/CMakeLists.txt b/dbms/programs/copier/CMakeLists.txt
index ed3e552..1271b1b 100644
--- a/dbms/programs/copier/CMakeLists.txt
+++ b/dbms/programs/copier/CMakeLists.txt
@@ -4,4 +4,5 @@ target_link_libraries (clickhouse-copier-lib PRIVATE clickhouse-server-lib click
if (CLICKHOUSE_SPLIT_BINARY)
add_executable (clickhouse-copier clickhouse-copier.cpp)
target_link_libraries (clickhouse-copier clickhouse-copier-lib)
+ install (TARGETS clickhouse-copier ${CLICKHOUSE_ALL_TARGETS} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT clickhouse-copier)
endif ()
diff --git a/dbms/programs/format/CMakeLists.txt b/dbms/programs/format/CMakeLists.txt
index 53d09e8..3c58cfb 100644
--- a/dbms/programs/format/CMakeLists.txt
+++ b/dbms/programs/format/CMakeLists.txt
@@ -3,4 +3,5 @@ target_link_libraries (clickhouse-format-lib PRIVATE dbms clickhouse_common_io c
if (CLICKHOUSE_SPLIT_BINARY)
add_executable (clickhouse-format clickhouse-format.cpp)
target_link_libraries (clickhouse-format PRIVATE clickhouse-format-lib)
+ install (TARGETS clickhouse-format ${CLICKHOUSE_ALL_TARGETS} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT clickhouse-format)
endif ()
diff --git a/dbms/programs/odbc-bridge/CMakeLists.txt b/dbms/programs/odbc-bridge/CMakeLists.txt
index a57c8c9..02a67fb 100644
--- a/dbms/programs/odbc-bridge/CMakeLists.txt
+++ b/dbms/programs/odbc-bridge/CMakeLists.txt
@@ -36,4 +36,5 @@ endif ()
if (CLICKHOUSE_SPLIT_BINARY)
add_executable (clickhouse-odbc-bridge odbc-bridge.cpp)
target_link_libraries (clickhouse-odbc-bridge PRIVATE clickhouse-odbc-bridge-lib)
+ install (TARGETS clickhouse-odbc-bridge ${CLICKHOUSE_ALL_TARGETS} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT clickhouse-odbc-bridge)
endif ()
diff --git a/dbms/programs/performance-test/CMakeLists.txt b/dbms/programs/performance-test/CMakeLists.txt
index f1a0817..a8b5f33 100644
--- a/dbms/programs/performance-test/CMakeLists.txt
+++ b/dbms/programs/performance-test/CMakeLists.txt
@@ -5,4 +5,5 @@ target_include_directories (clickhouse-performance-test-lib SYSTEM PRIVATE ${PCG
if (CLICKHOUSE_SPLIT_BINARY)
add_executable (clickhouse-performance-test clickhouse-performance-test.cpp)
target_link_libraries (clickhouse-performance-test PRIVATE clickhouse-performance-test-lib)
+ install (TARGETS clickhouse-performance-test ${CLICKHOUSE_ALL_TARGETS} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT clickhouse-performance-test)
endif ()
From: Alexander GQ Gerasiov <gq@cs.msu.su>
Date: Sun, 6 Jan 2019 01:59:33 +0300
Subject: Fix link with pthread when std::thread is used.
According to docs, you should add -lpthread when use std::thread in your code.
This doesn't matter if you build static binaries but fails the build when
one anable SPLIT_SHARED_LIBRARIES.
Signed-off-by: Alexander GQ Gerasiov <gq@cs.msu.su>
---
dbms/src/Common/Config/CMakeLists.txt | 2 +-
dbms/src/Common/ZooKeeper/tests/CMakeLists.txt | 2 +-
dbms/src/Common/tests/CMakeLists.txt | 8 ++++----
dbms/src/DataStreams/tests/CMakeLists.txt | 2 +-
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/dbms/src/Common/Config/CMakeLists.txt b/dbms/src/Common/Config/CMakeLists.txt
index a1bb279..0af2585 100644
--- a/dbms/src/Common/Config/CMakeLists.txt
+++ b/dbms/src/Common/Config/CMakeLists.txt
@@ -4,5 +4,5 @@ add_headers_and_sources(clickhouse_common_config .)
add_library(clickhouse_common_config ${LINK_MODE} ${clickhouse_common_config_headers} ${clickhouse_common_config_sources})
-target_link_libraries(clickhouse_common_config PUBLIC common PRIVATE clickhouse_common_zookeeper string_utils PUBLIC ${Poco_XML_LIBRARY} ${Poco_Util_LIBRARY})
+target_link_libraries(clickhouse_common_config PUBLIC common PRIVATE clickhouse_common_zookeeper string_utils PUBLIC ${Poco_XML_LIBRARY} ${Poco_Util_LIBRARY} pthread)
target_include_directories(clickhouse_common_config PUBLIC ${DBMS_INCLUDE_DIR})
diff --git a/dbms/src/Common/ZooKeeper/tests/CMakeLists.txt b/dbms/src/Common/ZooKeeper/tests/CMakeLists.txt
index 06716e4..282c4c6 100644
--- a/dbms/src/Common/ZooKeeper/tests/CMakeLists.txt
+++ b/dbms/src/Common/ZooKeeper/tests/CMakeLists.txt
@@ -11,7 +11,7 @@ add_executable(zkutil_expiration_test zkutil_expiration_test.cpp)
target_link_libraries(zkutil_expiration_test PRIVATE clickhouse_common_zookeeper)
add_executable(zkutil_test_async zkutil_test_async.cpp)
-target_link_libraries(zkutil_test_async PRIVATE clickhouse_common_zookeeper)
+target_link_libraries(zkutil_test_async PRIVATE clickhouse_common_zookeeper pthread)
add_executable(zkutil_zookeeper_holder zkutil_zookeeper_holder.cpp)
target_link_libraries(zkutil_zookeeper_holder PRIVATE clickhouse_common_zookeeper)
diff --git a/dbms/src/Common/tests/CMakeLists.txt b/dbms/src/Common/tests/CMakeLists.txt
index 05984c9..4f8e5c5 100644
--- a/dbms/src/Common/tests/CMakeLists.txt
+++ b/dbms/src/Common/tests/CMakeLists.txt
@@ -11,7 +11,7 @@ add_executable (auto_array auto_array.cpp)
target_link_libraries (auto_array PRIVATE clickhouse_common_io)
add_executable (lru_cache lru_cache.cpp)
-target_link_libraries (lru_cache PRIVATE clickhouse_common_io)
+target_link_libraries (lru_cache PRIVATE clickhouse_common_io pthread)
add_executable (hash_table hash_table.cpp)
target_link_libraries (hash_table PRIVATE clickhouse_common_io)
@@ -48,13 +48,13 @@ add_executable (pod_array pod_array.cpp)
target_link_libraries (pod_array PRIVATE clickhouse_common_io)
add_executable (thread_creation_latency thread_creation_latency.cpp)
-target_link_libraries (thread_creation_latency PRIVATE clickhouse_common_io)
+target_link_libraries (thread_creation_latency PRIVATE clickhouse_common_io pthread)
add_executable (thread_pool thread_pool.cpp)
target_link_libraries (thread_pool PRIVATE clickhouse_common_io)
add_executable (array_cache array_cache.cpp)
-target_link_libraries (array_cache PRIVATE clickhouse_common_io)
+target_link_libraries (array_cache PRIVATE clickhouse_common_io pthread)
add_executable (space_saving space_saving.cpp)
target_link_libraries (space_saving PRIVATE clickhouse_common_io)
@@ -70,4 +70,4 @@ add_executable (cow_columns cow_columns.cpp)
target_link_libraries (cow_columns PRIVATE clickhouse_common_io)
add_executable (stopwatch stopwatch.cpp)
-target_link_libraries (stopwatch PRIVATE clickhouse_common_io)
+target_link_libraries (stopwatch PRIVATE clickhouse_common_io pthread)
diff --git a/dbms/src/DataStreams/tests/CMakeLists.txt b/dbms/src/DataStreams/tests/CMakeLists.txt
index 3f6e154..310e7bc 100644
--- a/dbms/src/DataStreams/tests/CMakeLists.txt
+++ b/dbms/src/DataStreams/tests/CMakeLists.txt
@@ -7,7 +7,7 @@ add_executable (filter_stream filter_stream.cpp ${SRCS})
target_link_libraries (filter_stream PRIVATE dbms clickhouse_storages_system clickhouse_parsers clickhouse_common_io)
add_executable (union_stream2 union_stream2.cpp ${SRCS})
-target_link_libraries (union_stream2 PRIVATE dbms)
+target_link_libraries (union_stream2 PRIVATE dbms pthread)
add_executable (collapsing_sorted_stream collapsing_sorted_stream.cpp ${SRCS})
target_link_libraries (collapsing_sorted_stream PRIVATE dbms)
From: Alexander GQ Gerasiov <gq@cs.msu.su>
Date: Fri, 11 Jan 2019 03:27:28 +0300
Subject: Correctly find and use system metrohash library.
Also fix test conflict with new version of metrahash headers.
I think it would be bundle latest metrohash library into CH's contrib to keep
the codebase synced. (At least it breaks nothing.)
Signed-off-by: Alexander GQ Gerasiov <gq@cs.msu.su>
---
cmake/Modules/Findmetrohash.cmake | 2 +-
dbms/src/Functions/CMakeLists.txt | 4 +---
dbms/src/Interpreters/tests/CMakeLists.txt | 2 ++
dbms/src/Interpreters/tests/hash_map_string_3.cpp | 6 +++---
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/cmake/Modules/Findmetrohash.cmake b/cmake/Modules/Findmetrohash.cmake
index 9efc1ed..c516657 100644
--- a/cmake/Modules/Findmetrohash.cmake
+++ b/cmake/Modules/Findmetrohash.cmake
@@ -28,7 +28,7 @@ find_library(METROHASH_LIBRARIES
find_path(METROHASH_INCLUDE_DIR
NAMES metrohash.h
- PATHS ${METROHASH_ROOT_DIR}/include ${METROHASH_INCLUDE_PATHS}
+ PATHS ${METROHASH_ROOT_DIR}/include PATH_SUFFIXES metrohash ${METROHASH_INCLUDE_PATHS}
)
include(FindPackageHandleStandardArgs)
diff --git a/dbms/src/Functions/CMakeLists.txt b/dbms/src/Functions/CMakeLists.txt
index b4163c2..67e59e1 100644
--- a/dbms/src/Functions/CMakeLists.txt
+++ b/dbms/src/Functions/CMakeLists.txt
@@ -21,9 +21,7 @@ target_link_libraries(clickhouse_functions
${OPENSSL_CRYPTO_LIBRARY}
${CITYHASH_LIBRARIES})
-target_include_directories (clickhouse_functions SYSTEM BEFORE PUBLIC ${DBMS_INCLUDE_DIR} ${COMMON_INCLUDE_DIR} ${PCG_RANDOM_INCLUDE_DIR})
-
-target_include_directories (clickhouse_functions SYSTEM BEFORE PUBLIC ${DIVIDE_INCLUDE_DIR})
+target_include_directories (clickhouse_functions SYSTEM BEFORE PUBLIC ${DBMS_INCLUDE_DIR} ${COMMON_INCLUDE_DIR} ${PCG_RANDOM_INCLUDE_DIR} ${METROHASH_INCLUDE_DIR} ${DIVIDE_INCLUDE_DIR})
if (CONSISTENT_HASHING_INCLUDE_DIR)
target_include_directories (clickhouse_functions PRIVATE ${CONSISTENT_HASHING_INCLUDE_DIR})
diff --git a/dbms/src/Interpreters/tests/CMakeLists.txt b/dbms/src/Interpreters/tests/CMakeLists.txt
index 7660527..0211fc4 100644
--- a/dbms/src/Interpreters/tests/CMakeLists.txt
+++ b/dbms/src/Interpreters/tests/CMakeLists.txt
@@ -15,6 +15,7 @@ target_include_directories (hash_map SYSTEM BEFORE PRIVATE ${SPARCEHASH_INCLUDE_
target_link_libraries (hash_map PRIVATE dbms)
add_executable (hash_map3 hash_map3.cpp)
+target_include_directories(hash_map3 SYSTEM BEFORE PRIVATE ${METROHASH_INCLUDE_DIR})
target_link_libraries (hash_map3 PRIVATE dbms ${FARMHASH_LIBRARIES} ${METROHASH_LIBRARIES})
add_executable (hash_map_string hash_map_string.cpp)
@@ -25,6 +26,7 @@ add_executable (hash_map_string_2 hash_map_string_2.cpp)
target_link_libraries (hash_map_string_2 PRIVATE dbms)
add_executable (hash_map_string_3 hash_map_string_3.cpp)
+target_include_directories(hash_map_string_3 SYSTEM BEFORE PRIVATE ${METROHASH_INCLUDE_DIR})
target_link_libraries (hash_map_string_3 PRIVATE dbms ${FARMHASH_LIBRARIES} ${METROHASH_LIBRARIES})
add_executable (hash_map_string_small hash_map_string_small.cpp)
diff --git a/dbms/src/Interpreters/tests/hash_map_string_3.cpp b/dbms/src/Interpreters/tests/hash_map_string_3.cpp
index 24c923d..f242539 100644
--- a/dbms/src/Interpreters/tests/hash_map_string_3.cpp
+++ b/dbms/src/Interpreters/tests/hash_map_string_3.cpp
@@ -325,7 +325,7 @@ struct FarmHash64
template <void metrohash64(const uint8_t * key, uint64_t len, uint32_t seed, uint8_t * out)>
-struct MetroHash64
+struct SMetroHash64
{
size_t operator() (StringRef x) const
{
@@ -507,8 +507,8 @@ int main(int argc, char ** argv)
if (!m || m == 8) bench<StringRef, VerySimpleHash> (data, "StringRef_VerySimpleHash");
if (!m || m == 9) bench<StringRef, FarmHash64> (data, "StringRef_FarmHash64");
- if (!m || m == 10) bench<StringRef, MetroHash64<metrohash64_1>>(data, "StringRef_MetroHash64_1");
- if (!m || m == 11) bench<StringRef, MetroHash64<metrohash64_2>>(data, "StringRef_MetroHash64_2");
+ if (!m || m == 10) bench<StringRef, SMetroHash64<metrohash64_1>>(data, "StringRef_MetroHash64_1");
+ if (!m || m == 11) bench<StringRef, SMetroHash64<metrohash64_2>>(data, "StringRef_MetroHash64_2");
return 0;
}
From: Alexander GQ Gerasiov <gq@cs.msu.su>
Date: Mon, 21 Jan 2019 00:20:21 +0300
Subject: server/config.xml: Set log level to warning.
---
dbms/programs/server/config.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dbms/programs/server/config.xml b/dbms/programs/server/config.xml
index 514a081..3b4ad1d 100644
--- a/dbms/programs/server/config.xml
+++ b/dbms/programs/server/config.xml
@@ -2,7 +2,7 @@
<yandex>
<logger>
<!-- Possible levels: https://github.com/pocoproject/poco/blob/develop/Foundation/include/Poco/Logger.h#L105 -->
- <level>trace</level>
+ <level>warning</level>
<log>/var/log/clickhouse-server/clickhouse-server.log</log>
<errorlog>/var/log/clickhouse-server/clickhouse-server.err.log</errorlog>
<size>1000M</size>
From: Alexander GQ Gerasiov <gq@cs.msu.su>
Date: Thu, 31 Jan 2019 00:29:50 +0300
Subject: Set default umask to 027.
Signed-off-by: Alexander GQ Gerasiov <gq@cs.msu.su>
---
libs/libdaemon/src/BaseDaemon.cpp | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/libs/libdaemon/src/BaseDaemon.cpp b/libs/libdaemon/src/BaseDaemon.cpp
index bad38c7..696f686 100644
--- a/libs/libdaemon/src/BaseDaemon.cpp
+++ b/libs/libdaemon/src/BaseDaemon.cpp
@@ -887,16 +887,15 @@ void BaseDaemon::initialize(Application & self)
reloadConfiguration();
/// This must be done before creation of any files (including logs).
+ mode_t umask_num = 0027;
if (config().has("umask"))
{
std::string umask_str = config().getString("umask");
- mode_t umask_num = 0;
std::stringstream stream;
stream << umask_str;
stream >> std::oct >> umask_num;
-
- umask(umask_num);
}
+ umask(umask_num);
DB::ConfigProcessor(config_path).savePreprocessedConfig(loaded_config, "");
0001-Enable-link-time-optimization-flto.patch
0002-Remove-non-determinism.patch
0003-Fix-FTBFS-with-gcc-because-of-Wno-format.patch
0004-Disable-optimization-for-build-host.patch
0005-Use-system-installed-googletest.patch
0006-Disable-unwind.patch
0007-Disable-base64-usage-not-available-in-Debian-yet.patch
0008-Replace-cpuid-with-cpuinfo.patch
0009-Fix-install-of-binaries-when-SPLIT_BINARIES-is-set.patch
0010-Fix-link-with-pthread-when-std-thread-is-used.patch
0011-Change-libraries-hierarchy-links-most-of-them-into-m.patch
0012-Correctly-find-and-use-system-metrohash-library.patch
0013-server-config.xml-Set-log-level-to-warning.patch
0014-Set-default-umask-to-027.patch
#!/bin/sh
# CCACHEDIR - for pbuilder ; CCACHE_DIR - for ccache
echo "CCACHEDIR=$CCACHEDIR CCACHE_DIR=$CCACHE_DIR SET_CCACHEDIR=$SET_CCACHEDIR"
[ -z "$CCACHE_DIR" ] && export CCACHE_DIR=${CCACHEDIR:=${SET_CCACHEDIR=/var/cache/pbuilder/ccache}}
if [ -n "$CCACHE_DIR" ]; then
mkdir -p $CCACHE_DIR $DISTCC_DIR ||:
chown -R $BUILDUSERID:$BUILDUSERID $CCACHE_DIR $DISTCC_DIR ||:
chmod -R a+rwx $CCACHE_DIR $DISTCC_DIR ||:
fi
df -h
ccache --show-stats
ccache -M ${CCACHE_SIZE:=32G}
#!/bin/sh
# https://github.com/llvm-mirror/libcxx/commit/6e02e89f65ca1ca1d6ce30fbc557563164dd327e
touch /usr/include/xlocale.h
#!/usr/bin/env bash
set -e
set -x
TEST_CONNECT=${TEST_CONNECT=1}
TEST_SSL=${TEST_SSL=1}
PACKAGE_INSTALL=${PACKAGE_INSTALL=1}
TEST_PORT_RANDOM=${TEST_PORT_RANDOM=1}
if [ "${PACKAGE_INSTALL}" ]; then
for PKG in $(ls /tmp/buildd/*.deb | sed -e's,.*/,,;s,_.*,,' ); do
apt-get install -y --force-yes "$PKG" ||:
apt-get remove -y "$PKG" ||:
done