...
 
Commits (8)
* 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+ds-2) unstable; urgency=medium
* 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.
-- 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)
......
#!/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
......@@ -16,7 +16,7 @@ Build-Depends: cmake,
libboost-thread-dev,
libcapnp-dev,
libcctz-dev,
libcpuinfo-dev,
libcpuinfo-dev [amd64 arm64],
libdouble-conversion-dev,
libfarmhash-dev,
libglib2.0-dev,
......@@ -53,7 +53,7 @@ Vcs-Git: https://salsa.debian.org/debian/ClickHouse.git
Vcs-Browser: https://salsa.debian.org/debian/ClickHouse
Package: clickhouse-common
Architecture: any
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
......@@ -62,8 +62,9 @@ Description: column-oriented database system (common files)
This package provides common files for both ClickHouse server and client.
Package: clickhouse-server
Architecture: any
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.
......@@ -71,7 +72,7 @@ Description: column-oriented database system (server runner)
This package provides ClickHouse server runner.
Package: clickhouse-client
Architecture: any
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
......@@ -80,7 +81,7 @@ Description: column-oriented database system (cli client)
This package provides ClickHouse CLI client.
Package: clickhouse-tools
Architecture: any
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
......
......@@ -9,12 +9,13 @@ 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 | 14 ++++++++
contrib/CMakeLists.txt | 4 ---
dbms/CMakeLists.txt | 6 +---
dbms/src/Common/getNumberOfPhysicalCPUCores.cpp | 47 +++++--------------------
6 files changed, 25 insertions(+), 77 deletions(-)
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
......@@ -68,10 +69,10 @@ index cda8843..0000000
-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..f0cdfd6
index 0000000..959119f
--- /dev/null
+++ b/cmake/find_cpuinfo.cmake
@@ -0,0 +1,14 @@
@@ -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 ()
......@@ -79,10 +80,12 @@ index 0000000..f0cdfd6
+if (NOT USE_INTERNAL_CPUINFO_LIBRARY)
+ find_library (CPUINFO_LIBRARY cpuinfo)
+ find_path (CPUINFO_INCLUDE_DIR NAMES cpuinfo.h PATHS ${CPUINFO_INCLUDE_PATHS})
+elseif (NOT MISSING_INTERNAL_CPUINFO_LIBRARY)
+ set (CPUINFO_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/contrib/libcpuinfo/include)
+ set (USE_INTERNAL_CPUINFO_LIBRARY 1)
+ set (CPUINFO_LIBRARY cpuinfo)
+endif ()
+
+if (CPUINFO_LIBRARY)
+ set(USE_CPUINFO 1)
+else()
+ set(USE_CPUINFO 0)
+endif ()
+
+message (STATUS "Using cpuinfo: ${CPUINFO_INCLUDE_DIR} : ${CPUINFO_LIBRARY}")
......@@ -102,10 +105,10 @@ index ab453b9..8941e96 100644
if (NOT MAKE_STATIC_LIBRARIES)
set (BUILD_SHARED 1)
diff --git a/dbms/CMakeLists.txt b/dbms/CMakeLists.txt
index b7f1173..a82a0c4 100644
index b7f1173..0e4a36a 100644
--- a/dbms/CMakeLists.txt
+++ b/dbms/CMakeLists.txt
@@ -142,17 +142,13 @@ if (CMAKE_BUILD_TYPE_UC STREQUAL "RELEASE" OR CMAKE_BUILD_TYPE_UC STREQUAL "RELW
@@ -142,17 +142,12 @@ if (CMAKE_BUILD_TYPE_UC STREQUAL "RELEASE" OR CMAKE_BUILD_TYPE_UC STREQUAL "RELW
PROPERTIES COMPILE_FLAGS -g0)
endif ()
......@@ -120,15 +123,38 @@ index b7f1173..a82a0c4 100644
string_utils
widechar_width
- ${LINK_LIBRARIES_ONLY_ON_X86_64}
+ ${CPUINFO_LIBRARY}
${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..ea274df 100644
index 0a686b9..9832574 100644
--- a/dbms/src/Common/getNumberOfPhysicalCPUCores.cpp
+++ b/dbms/src/Common/getNumberOfPhysicalCPUCores.cpp
@@ -1,45 +1,16 @@
@@ -1,45 +1,25 @@
#include <Common/getNumberOfPhysicalCPUCores.h>
#include <thread>
......@@ -140,7 +166,9 @@ index 0a686b9..ea274df 100644
- namespace DB { namespace ErrorCodes { extern const int CPUID_ERROR; }}
-
-#endif
-
+#include <Common/config.h>
+#if USE_CPUINFO
+#include <cpuinfo.h>
unsigned getNumberOfPhysicalCPUCores()
......@@ -183,3 +211,9 @@ index 0a686b9..ea274df 100644
+ else
+ return std::thread::hardware_concurrency();
}
+#else
+unsigned getNumberOfPhysicalCPUCores()
+{
+ return std::thread::hardware_concurrency();
+}
+#endif
......@@ -30,15 +30,14 @@ index 5c919b2..7f1869d 100644
set(PCG_RANDOM_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/contrib/libpcg-random/include)
+set(CITYHASH_CONTRIB_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/contrib/cityhash102/include)
diff --git a/dbms/CMakeLists.txt b/dbms/CMakeLists.txt
index a82a0c4..bae3f93 100644
index 0e4a36a..0cad596 100644
--- a/dbms/CMakeLists.txt
+++ b/dbms/CMakeLists.txt
@@ -148,12 +148,13 @@ target_link_libraries (clickhouse_common_io
@@ -148,11 +148,12 @@ target_link_libraries (clickhouse_common_io
PRIVATE
string_utils
widechar_width
+ PUBLIC
${CPUINFO_LIBRARY}
${LZ4_LIBRARY}
${ZSTD_LIBRARY}
${DOUBLE_CONVERSION_LIBRARIES}
......@@ -48,7 +47,7 @@ index a82a0c4..bae3f93 100644
${Poco_Net_LIBRARY}
${Poco_Util_LIBRARY}
${Poco_Foundation_LIBRARY}
@@ -173,14 +174,17 @@ target_link_libraries (clickhouse_common_io
@@ -180,14 +181,17 @@ endif ()
target_link_libraries (dbms
PRIVATE
......
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, "");
......@@ -11,3 +11,4 @@
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