MCPcopy Create free account
hub / github.com/apache/cloudstack / is_service_running

Function is_service_running

python/lib/cloud_utils.py:221–233  ·  view source on GitHub ↗
(servicename)

Source from the content-addressed store, hash-verified

219
220
221def is_service_running(servicename):
222 try:
223 o = service(servicename,"status")
224 if distro is Ubuntu:
225 # status in ubuntu does not signal service status via return code
226 if "start/running" in o.stdout: return True
227 return False
228 else:
229 # retcode 0, service running
230 return True
231 except CalledProcessError as e:
232 # retcode nonzero, service not running
233 return False
234
235
236def stop_service(servicename,force=False):

Callers 2

stop_serviceFunction · 0.85
start_serviceFunction · 0.85

Calls 1

serviceFunction · 0.50

Tested by

no test coverage detected