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

Function restartService

systemvm/debian/root/monitorServices.py:175–189  ·  view source on GitHub ↗
(service_name)

Source from the content-addressed store, hash-verified

173 return False,pids
174
175def restartService(service_name):
176
177 cmd = 'service ' + service_name + ' restart'
178 cout = Popen(cmd, shell=True, stdout=PIPE, stderr=STDOUT)
179 return_val = cout.wait()
180
181 if return_val == 0:
182 printd("The service " + service_name +" recovered successfully ")
183 msg="The process " +service_name+" is recovered successfully "
184 raisealert(Log.INFO,msg,service_name)
185 return True
186 else:
187 printd("process restart failed ....")
188
189 return False
190
191def checkProcessStatus( process ):
192 """

Callers 1

checkProcessStatusFunction · 0.70

Calls 3

printdFunction · 0.85
raisealertFunction · 0.85
waitMethod · 0.45

Tested by

no test coverage detected