Ori.livneh has submitted this change and it was merged.

Change subject: Make Upstart_job check service status before attempting to 
start it
......................................................................


Make Upstart_job check service status before attempting to start it

Also touch twemproxy upstart config to make it refresh the upstart_job so we
can test it.

Change-Id: Icdc52139a629c261b957bca636ee36ffe4b28aa4
---
M modules/generic/files/upstart/twemproxy.conf
M modules/generic/manifests/upstart_job.pp
2 files changed, 6 insertions(+), 0 deletions(-)

Approvals:
  Ori.livneh: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/generic/files/upstart/twemproxy.conf 
b/modules/generic/files/upstart/twemproxy.conf
index 2f24c20..bf13fc1 100644
--- a/modules/generic/files/upstart/twemproxy.conf
+++ b/modules/generic/files/upstart/twemproxy.conf
@@ -1,3 +1,8 @@
+# vim: set ft=upstart:
+
+# Upstart job configuration for twemproxy
+# This file is managed by Puppet
+
 description "twemproxy"
 
 start on (net-device-up
diff --git a/modules/generic/manifests/upstart_job.pp 
b/modules/generic/manifests/upstart_job.pp
index a2e5b46..330f31a 100644
--- a/modules/generic/manifests/upstart_job.pp
+++ b/modules/generic/manifests/upstart_job.pp
@@ -17,6 +17,7 @@
                        subscribe => File["/etc/init/${title}.conf"],
                        refreshonly => true,
                        command => "start ${title}",
+                       unless => "status ${title} | grep -q start/running",
                        path => "/bin:/sbin:/usr/bin:/usr/sbin"
                }
        }

-- 
To view, visit https://gerrit.wikimedia.org/r/92840
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Icdc52139a629c261b957bca636ee36ffe4b28aa4
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to