From dd92a34202b6e1176c4fb35de443c9c71a1c7d0c Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Fri, 22 Nov 2019 15:10:44 +0100 Subject: [PATCH] Uh idk we also need to run this explicitly with /bin/bash --- src/yunohost/service.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/yunohost/service.py b/src/yunohost/service.py index 9eb14012e..f8553fbf7 100644 --- a/src/yunohost/service.py +++ b/src/yunohost/service.py @@ -335,8 +335,15 @@ def service_status(names=[]): # 'test_status' is an optional field to test the status of the service using a custom command if "test_status" in services[name]: - status = os.system(services[name]["test_status"]) - result[name]["status"] = "running" if status == 0 else "failed" + p = subprocess.Popen(services[name]["test_status"], + shell=True, + executable='/bin/bash', + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT) + + p.communicate() + + result[name]["status"] = "running" if p.returncode == 0 else "failed" # 'test_status' is an optional field to test the status of the service using a custom command if "test_conf" in services[name]: