Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix up service module to make it start processes that are listed to be #316

Merged
merged 1 commit into from
May 6, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions library/service
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@ status = status_stdout + status_stderr


running = False
if status_stdout.find("not running") != -1:
if status_stdout.find("stopped") != -1 or rc == 3:
running = False
elif status_stdout.find("running") != -1:
elif status_stdout.find("running") != -1 or rc == 0:
running = True
elif name == 'iptables' and status_stdout.find("ACCEPT") != -1:
# iptables status command output is lame
Expand All @@ -165,7 +165,7 @@ if state or enable:
# ===========================================
# determine if we are going to change anything

if not running and state == "started":
if not running and state in ("started", "running"):
changed = True
elif running and state == "stopped":
changed = True
Expand All @@ -183,13 +183,13 @@ if state or enable:
elif state == 'restarted':
rc1, stdout1, stderr1 = _run("%s %s stop" % (SERVICE, name))
rc2, stdout2, stderr2 = _run("%s %s start" % (SERVICE, name))
rc_state = rc and rc1 and rc2
rc_state = rc + rc1 + rc2
stdout = stdout1 + stdout2
stderr = stderr1 + stderr2

out += stdout
err += stderr
rc = rc and rc_state
rc = rc + rc_state

if rc != 0:

Expand Down