mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 07:01:59 +00:00
Metrica:
в шаблон init скрипта добавлена логика по отключению крона по команде stop и включению по start
This commit is contained in:
parent
390bf11869
commit
99d487325c
@ -19,6 +19,7 @@
|
||||
macro (CREATE_INIT_SCRIPT initname daemonname)
|
||||
add_custom_target(${initname}.target ALL
|
||||
COMMAND sed -e 's,[@]DAEMON[@],${daemonname},g' < ${PROJECT_SOURCE_DIR}/tools/init.d/template > ${CMAKE_CURRENT_BINARY_DIR}/${initname}
|
||||
COMMAND sed -i 's,[@]CRONFILE[@],${initname}-metrica-yandex,g' ${CMAKE_CURRENT_BINARY_DIR}/${initname}
|
||||
COMMAND chmod a+x ${CMAKE_CURRENT_BINARY_DIR}/${initname}
|
||||
COMMENT "Building ${initname}"
|
||||
)
|
||||
|
@ -15,6 +15,7 @@ PIDDIR=/var/run/$PROGRAM
|
||||
LOGDIR=/var/log/$PROGRAM
|
||||
LOCALSTATEDIR=/var/lock
|
||||
BINDIR=/usr/bin
|
||||
CRONFILE=/etc/cron.d/@CRONFILE@
|
||||
|
||||
[ -x $BINDIR/$PROGRAM ] || exit 0
|
||||
|
||||
@ -91,14 +92,24 @@ restart()
|
||||
start
|
||||
}
|
||||
|
||||
enable_cron()
|
||||
{
|
||||
sed -i 's/^#*//' "$CRONFILE"
|
||||
}
|
||||
|
||||
disable_cron()
|
||||
{
|
||||
sed -i 's/^#*/#/' "$CRONFILE"
|
||||
}
|
||||
|
||||
# See how we were called.
|
||||
EXIT_STATUS=0
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
enable_cron && start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
disable_cron && stop
|
||||
;;
|
||||
status)
|
||||
isrun && echo "$PROGRAM service is running" || echo "$PROGRAM service is stopped"
|
||||
|
Loading…
Reference in New Issue
Block a user