|
|
@ -225,6 +225,7 @@ def main():
|
|
|
|
# ===========================================
|
|
|
|
# ===========================================
|
|
|
|
# run change commands if we need to
|
|
|
|
# run change commands if we need to
|
|
|
|
if changed:
|
|
|
|
if changed:
|
|
|
|
|
|
|
|
|
|
|
|
if state in ['started', 'running']:
|
|
|
|
if state in ['started', 'running']:
|
|
|
|
rc_state, stdout, stderr = _run("%s %s start" % (SERVICE, name))
|
|
|
|
rc_state, stdout, stderr = _run("%s %s start" % (SERVICE, name))
|
|
|
|
elif state == 'stopped':
|
|
|
|
elif state == 'stopped':
|
|
|
@ -234,6 +235,11 @@ def main():
|
|
|
|
elif state == 'restarted':
|
|
|
|
elif state == 'restarted':
|
|
|
|
rc1, stdout1, stderr1 = _run("%s %s stop" % (SERVICE, name))
|
|
|
|
rc1, stdout1, stderr1 = _run("%s %s stop" % (SERVICE, name))
|
|
|
|
rc2, stdout2, stderr2 = _run("%s %s start" % (SERVICE, name))
|
|
|
|
rc2, stdout2, stderr2 = _run("%s %s start" % (SERVICE, name))
|
|
|
|
|
|
|
|
if rc1 != 0 and rc2 == 0:
|
|
|
|
|
|
|
|
rc_state = rc + rc2
|
|
|
|
|
|
|
|
stdout = stdout2
|
|
|
|
|
|
|
|
stderr = stderr2
|
|
|
|
|
|
|
|
else:
|
|
|
|
rc_state = rc + rc1 + rc2
|
|
|
|
rc_state = rc + rc1 + rc2
|
|
|
|
stdout = stdout1 + stdout2
|
|
|
|
stdout = stdout1 + stdout2
|
|
|
|
stderr = stderr1 + stderr2
|
|
|
|
stderr = stderr1 + stderr2
|
|
|
|