From e58edd4fe9086d1d60d4ebab53c529dd6fe406b9 Mon Sep 17 00:00:00 2001 From: seglo Date: Mon, 6 Jun 2016 09:35:00 -0400 Subject: [PATCH] Support systemd status to return 0 exit code when status OK #4 --- package/scripts/cassandra_master.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/package/scripts/cassandra_master.py b/package/scripts/cassandra_master.py index 9cb2f7d..8ac8c22 100755 --- a/package/scripts/cassandra_master.py +++ b/package/scripts/cassandra_master.py @@ -52,7 +52,12 @@ def start(self, env): def status(self, env): import params env.set_params(params) - status_cmd = format("service cassandra status") + status_cmd = format(""" + if hash systemctl 2>/dev/null; then + systemctl status cassandra + else + service cassandra status + fi""") Execute(status_cmd) print 'Status of the Master'