mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 00:30:49 +00:00
init.d template: [#CONV-960].
This commit is contained in:
parent
bee9f2ea55
commit
c7a73d68ca
@ -79,7 +79,7 @@ stop()
|
|||||||
if isrun; then
|
if isrun; then
|
||||||
if [ -f "$LOCKFILE" ]; then
|
if [ -f "$LOCKFILE" ]; then
|
||||||
rm -f "$LOCKFILE"
|
rm -f "$LOCKFILE"
|
||||||
kill -INT `cat "$PIDFILE"`
|
kill -TERM `cat "$PIDFILE"`
|
||||||
wait4done
|
wait4done
|
||||||
else
|
else
|
||||||
echo "has been stopping already"
|
echo "has been stopping already"
|
||||||
@ -97,6 +97,34 @@ restart()
|
|||||||
start
|
start
|
||||||
}
|
}
|
||||||
|
|
||||||
|
forcestop()
|
||||||
|
{
|
||||||
|
local EXIT_STATUS
|
||||||
|
EXIT_STATUS=0
|
||||||
|
|
||||||
|
echo -n "Stop $PROGRAM service: "
|
||||||
|
|
||||||
|
if isrun; then
|
||||||
|
if [ -f "$LOCKFILE" ]; then
|
||||||
|
rm -f "$LOCKFILE"
|
||||||
|
kill -9 `cat "$PIDFILE"`
|
||||||
|
wait4done
|
||||||
|
else
|
||||||
|
echo "has been stopping already"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "DONE"
|
||||||
|
return $EXIT_STATUS
|
||||||
|
}
|
||||||
|
|
||||||
|
forcerestart()
|
||||||
|
{
|
||||||
|
forcestop
|
||||||
|
start
|
||||||
|
}
|
||||||
|
|
||||||
enable_cron()
|
enable_cron()
|
||||||
{
|
{
|
||||||
sed -i 's/^#*//' "$CRONFILE"
|
sed -i 's/^#*//' "$CRONFILE"
|
||||||
@ -122,6 +150,12 @@ case "$1" in
|
|||||||
restart)
|
restart)
|
||||||
restart && enable_cron
|
restart && enable_cron
|
||||||
;;
|
;;
|
||||||
|
forcestop)
|
||||||
|
disable_cron && forcestop
|
||||||
|
;;
|
||||||
|
forcerestart)
|
||||||
|
forcerestart && enable_cron
|
||||||
|
;;
|
||||||
reload)
|
reload)
|
||||||
restart
|
restart
|
||||||
;;
|
;;
|
||||||
|
Loading…
Reference in New Issue
Block a user