gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-deployment] branch master updated: Improve process termination


From: gnunet
Subject: [taler-deployment] branch master updated: Improve process termination
Date: Sat, 29 May 2021 08:53:15 +0200

This is an automated email from the git hooks/post-receive script.

ms pushed a commit to branch master
in repository deployment.

The following commit(s) were added to refs/heads/master by this push:
     new 2877920  Improve process termination
2877920 is described below

commit 2877920de2dc6c544ca3ff3b247fcd06efb292a8
Author: MS <ms@taler.net>
AuthorDate: Sat May 29 08:53:11 2021 +0200

    Improve process termination
---
 bin/taler-deployment-config-instances | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/bin/taler-deployment-config-instances 
b/bin/taler-deployment-config-instances
index ad1feec..27c5c17 100755
--- a/bin/taler-deployment-config-instances
+++ b/bin/taler-deployment-config-instances
@@ -47,11 +47,11 @@ def wait_merchant_up():
 
         # Ready.
         print("Merchant is up and running")
-        break
+        return True
 
     if checks == 0:
-        print("Could not start the merchant (with TALER_MERCHANT_TOKEN in the 
env).")
-        exit(1)
+        print("Merchant is not correctly serving requests.")
+        return False
 
 
 MERCHANT_BACKEND_BASE_URL = expect_env("TALER_ENV_MERCHANT_BACKEND")
@@ -140,7 +140,10 @@ def ensure_default_instance():
     # Start the merchant natively.
     merchant = Popen(["taler-merchant-httpd"], env=env_with_token)
 
-    wait_merchant_up()
+    if not wait_merchant_up():
+        merchant.terminate()
+        merchant.wait()
+        exit(1)
     
     print("Merchant started successfully, creating the default instance now.")
     ensure_instance(
@@ -149,17 +152,20 @@ def ensure_default_instance():
         
payto_uris=[f"payto://x-taler-bank/bank.{TALER_ENV_NAME}.taler.net/Taler"],
         auth=dict(method="token", token=TALER_ENV_FRONTENDS_APITOKEN)
     )
-
+    # Native process can be terminated now.
     merchant.terminate()
     merchant.wait()
     print("Merchant terminated, restarting it via ARM now.")
-
+    # Restarting the official ARM merchant.
     system("taler-deployment-arm -i taler-merchant")
 
 ensure_default_instance()
+
 # Needs to wait here since the merchant got lastly restarted via ARM,
 # in the previous operation.
-wait_merchant_up()
+if not wait_merchant_up():
+    system("taler-deployment-arm -k taler-merchant")
+    exit(1)
 
 ensure_instance(
     "blog",

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]