2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-22 09:32:21 +00:00

Fixes around the confluent shutdown facility

This commit is contained in:
Jarrod Johnon 2014-10-28 13:42:21 -04:00
parent 9d7aa2c51f
commit f7fb9d6af2
3 changed files with 9 additions and 2 deletions

View File

@ -325,9 +325,13 @@ def do_command(command, server):
delresource(argv[1])
elif argv[0] in ('unset', 'clear'):
clearvalues(argv[1], argv[2:])
elif argv[0] == 'shutdown':
shutdown()
else:
sys.stderr.write("%s: command not found...\n" % argv[0])
def shutdown():
tlvdata.send(session.connection, {'operation': 'shutdown', 'path': '/'})
def createresource(args):
resname = args[0]

View File

@ -23,6 +23,7 @@ import os
import pwd
import stat
import struct
import sys
import traceback
import eventlet.green.socket as socket
@ -110,6 +111,8 @@ def sessionhdl(connection, authname, skipauth=False):
tlvdata.send(connection, {'errorcode': 504,
'error': 'Unreachable Target'})
tlvdata.send(connection, {'_requestdone': 1})
except SystemExit:
sys.exit(0)
except:
tracelog.log(traceback.format_exc(), ltype=log.DataTypes.event,
event=log.Events.stacktrace)

View File

@ -13,7 +13,7 @@
case $1 in
restart)
echo -n 'Stopping Confluent '
/opt/confluent/bin/confetty shutdown
/opt/confluent/bin/confetty shutdown /
echo -n 'Starting Confluent '
/opt/confluent/bin/confluent
success
@ -25,7 +25,7 @@ case $1 in
;;
stop)
echo -n 'Stopping Confluent '
/opt/confluent/bin/confetty shutdown
/opt/confluent/bin/confetty shutdown /
success
;;
esac