summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/taler-merchant-demos26
1 files changed, 17 insertions, 9 deletions
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()