Skip to content

Commit 1145dbf

Browse files
Backport ClickHouse#88746 to 25.8: Startup clickhouse-keeper on boot
1 parent 0570c95 commit 1145dbf

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

packages/clickhouse-keeper.postinstall

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,25 @@ if [ "$1" = configure ] || [ -n "$not_deb_os" ]; then
2828
"${KEEPER_USER}"
2929
fi
3030

31+
if [ -x "/bin/systemctl" ] && [ -f /lib/systemd/system/clickhouse-keeper.service ] && [ -d /run/systemd/system ]; then
32+
# if old rc.d service present - remove it
33+
if [ -x "/etc/init.d/clickhouse-keeper" ] && [ -x "/usr/sbin/update-rc.d" ]; then
34+
/usr/sbin/update-rc.d clickhouse-keeper remove
35+
fi
36+
37+
/bin/systemctl daemon-reload
38+
/bin/systemctl enable clickhouse-keeper
39+
else
40+
# If you downgrading to version older than 1.1.54336 run: systemctl disable clickhouse-keeper
41+
if [ -x "/etc/init.d/clickhouse-keeper" ]; then
42+
if [ -x "/usr/sbin/update-rc.d" ]; then
43+
/usr/sbin/update-rc.d clickhouse-keeper defaults 19 19 >/dev/null || exit $?
44+
else
45+
echo # Other OS
46+
fi
47+
fi
48+
fi
49+
3150
chown -R "${KEEPER_USER}:${KEEPER_GROUP}" "${KEEPER_CONFDIR}"
3251
chmod 0755 "${KEEPER_CONFDIR}"
3352

0 commit comments

Comments
 (0)