From 7a133e0a7ffc2499b86bc6b8c780cc4cc60f0a60 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Fri, 25 Oct 2024 17:19:12 +0200 Subject: [PATCH] Update clickhouse-server.postinstall --- packages/clickhouse-server.postinstall | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/clickhouse-server.postinstall b/packages/clickhouse-server.postinstall index db0fff67381..d245a5189d5 100644 --- a/packages/clickhouse-server.postinstall +++ b/packages/clickhouse-server.postinstall @@ -26,8 +26,11 @@ if [ ! -f "/etc/debian_version" ]; then fi if [ "$1" = configure ] || [ -n "$not_deb_os" ]; then - installed=$(dpkg -l | grep "^ii\s\+clickhouse-server ") - # already installed, use old "is-enabled" status + # 'ii' means install and installed + # ('ic' for Installed but configuration incomplete) + # If it is the first installation, we might encounter the 'ic' (Incomplete) status when executing the postinst script + installed=$(dpkg -l | grep '^ii\s+clickhouse-server') + # already installed, use the old "is-enabled" status if [ -n "$installed" ]; then status=$(systemctl is-enabled clickhouse-server 2>/dev/null) fi