CLICKHOUSE-4511 Fix forcerestart with systemd

This commit is contained in:
proller 2019-05-06 15:12:18 +03:00
parent c280907f09
commit 0e0a0f6ee6
3 changed files with 11 additions and 8 deletions

View File

@ -238,7 +238,8 @@ forcestop()
forcerestart()
{
forcestop
start
# Should not use 'start' function if systemd active
service $PROGRAM start
}
use_cron()
@ -291,7 +292,8 @@ main()
restart && enable_cron
;;
forcestop)
disable_cron && forcestop
disable_cron
forcestop
;;
forcerestart)
forcerestart && enable_cron
@ -300,16 +302,16 @@ main()
restart
;;
condstart)
is_running || start
is_running || service $PROGRAM start
;;
condstop)
is_running && stop
is_running && service $PROGRAM stop
;;
condrestart)
is_running && restart
is_running && service $PROGRAM restart
;;
condreload)
is_running && restart
is_running && service $PROGRAM restart
;;
initdb)
initdb

View File

@ -7,7 +7,8 @@ User=clickhouse
Group=clickhouse
Restart=always
RestartSec=30
ExecStart=/usr/bin/clickhouse-server --config=/etc/clickhouse-server/config.xml
RuntimeDirectory=clickhouse-server
ExecStart=/usr/bin/clickhouse-server --config=/etc/clickhouse-server/config.xml --pid-file=/run/clickhouse-server/clickhouse-server.pid
LimitCORE=infinity
LimitNOFILE=500000
CapabilityBoundingSet=CAP_NET_ADMIN CAP_IPC_LOCK

View File

@ -1083,7 +1083,7 @@ void BaseDaemon::initialize(Application & self)
}
/// Create pid file.
if (is_daemon && config().has("pid"))
if (config().has("pid"))
pid.seed(config().getString("pid"));
/// Change path for logging.