mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
debian/clickhouse-server.init: systemd proxying for restart/start/stop/reload
This commit is contained in:
parent
b4a1f59ada
commit
3678d3256a
14
debian/clickhouse-server.init
vendored
14
debian/clickhouse-server.init
vendored
@ -276,13 +276,12 @@ use_cron()
|
|||||||
fi
|
fi
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
# returns false if cron disabled (with systemd)
|
||||||
enable_cron()
|
enable_cron()
|
||||||
{
|
{
|
||||||
use_cron && sed -i 's/^#*//' "$CLICKHOUSE_CRONFILE"
|
use_cron && sed -i 's/^#*//' "$CLICKHOUSE_CRONFILE"
|
||||||
}
|
}
|
||||||
|
# returns false if cron disabled (with systemd)
|
||||||
|
|
||||||
disable_cron()
|
disable_cron()
|
||||||
{
|
{
|
||||||
use_cron && sed -i 's/^#*/#/' "$CLICKHOUSE_CRONFILE"
|
use_cron && sed -i 's/^#*/#/' "$CLICKHOUSE_CRONFILE"
|
||||||
@ -305,15 +304,14 @@ main()
|
|||||||
EXIT_STATUS=0
|
EXIT_STATUS=0
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
start && enable_cron
|
service_or_func start && enable_cron
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
# disable_cron returns false if cron disabled (with systemd) - not checking return status
|
|
||||||
disable_cron
|
disable_cron
|
||||||
stop
|
service_or_func stop
|
||||||
;;
|
;;
|
||||||
restart)
|
restart)
|
||||||
restart && enable_cron
|
service_or_func restart && enable_cron
|
||||||
;;
|
;;
|
||||||
forcestop)
|
forcestop)
|
||||||
disable_cron
|
disable_cron
|
||||||
@ -323,7 +321,7 @@ main()
|
|||||||
forcerestart && enable_cron
|
forcerestart && enable_cron
|
||||||
;;
|
;;
|
||||||
reload)
|
reload)
|
||||||
restart
|
service_or_func restart
|
||||||
;;
|
;;
|
||||||
condstart)
|
condstart)
|
||||||
is_running || service_or_func start
|
is_running || service_or_func start
|
||||||
|
Loading…
Reference in New Issue
Block a user