diff --git a/confluent_client/bin/confetty b/confluent_client/bin/confetty index e45fef9d..9f890888 100755 --- a/confluent_client/bin/confetty +++ b/confluent_client/bin/confetty @@ -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] diff --git a/confluent_server/confluent/sockapi.py b/confluent_server/confluent/sockapi.py index f8b31cc4..d8895d6e 100644 --- a/confluent_server/confluent/sockapi.py +++ b/confluent_server/confluent/sockapi.py @@ -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) diff --git a/confluent_server/sysvinit/confluent b/confluent_server/sysvinit/confluent index fad6b4c7..35860f6b 100755 --- a/confluent_server/sysvinit/confluent +++ b/confluent_server/sysvinit/confluent @@ -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