Adding cron config checking before running sed cmd (#42081)

Co-authored-by: Nikita Mikhaylov <mikhaylovnikitka@gmail.com>
This commit is contained in:
Chun-Sheng, Li 2022-10-10 19:34:38 +08:00 committed by GitHub
parent dac71f445b
commit 33edab5042
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -120,7 +120,11 @@ use_cron()
if [ -x "/bin/systemctl" ] && [ -f /etc/systemd/system/clickhouse-server.service ] && [ -d /run/systemd/system ]; then
return 1
fi
# 2. disabled by config
# 2. checking whether the config is existed
if [ ! -f "$CLICKHOUSE_CRONFILE" ]; then
return 1
fi
# 3. disabled by config
if [ -z "$CLICKHOUSE_CRONFILE" ]; then
return 2
fi