From 063e68ec063ea29e32da920de83dbdad3fec185e Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 23 Aug 2020 11:58:15 +0200 Subject: fix #6510 --- bin/taler-merchant-demos | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'bin') diff --git a/bin/taler-merchant-demos b/bin/taler-merchant-demos index b4ac156..098416a 100755 --- a/bin/taler-merchant-demos +++ b/bin/taler-merchant-demos @@ -59,7 +59,11 @@ def handle_serve_uwsgi(config, whichShop): params.extend(["--chmod-socket="+mode]) os.makedirs(os.path.dirname(spec), exist_ok=True) logging.info("launching uwsgi with argv %s", params[1:]) - os.execlp(*params) + try: + os.execlp(*params) + except: + echo "Failed to start uwsgi. Please make sure to install uwsgi for Python3." + sys.exit(1) ## # This function interprets the 'serve-http' subcommand. @@ -70,12 +74,16 @@ def handle_serve_http(config, whichShop, port=None): if port is None: port = config[whichShop]["http_port"].value_int(required=True) spec = ":%d" % (port,) - os.execlp("uwsgi", "uwsgi", - "--master", - "--die-on-term", - "--log-format", UWSGI_LOGFMT, - "--http", spec, - "--module", "talermerchantdemos.{}:app".format(whichShop)) + try: + os.execlp("uwsgi", "uwsgi", + "--master", + "--die-on-term", + "--log-format", UWSGI_LOGFMT, + "--http", spec, + "--module", "talermerchantdemos.{}:app".format(whichShop)) + except: + echo "Failed to start uwsgi. Please make sure to install uwsgi for Python3." + sys.exit(1) @click.command("Global shop launcher") @click.option("--config", help="Configuration file", required=False) @@ -92,7 +100,7 @@ def demos(config, serve_http, port, serve_uwsgi, which_shop): config_obj = TalerConfig.from_file(os.environ.get("TALER_CONFIG_FILE")) if serve_http: # port was given handle_serve_http(config_obj, which_shop, port) - return - handle_serve_uwsgi(config_obj, which_shop) + else: + handle_serve_uwsgi(config_obj, which_shop) demos() -- cgit v1.2.3