summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorThom May <thom@may.lt>2016-08-25 17:08:49 +0100
committerGitHub <noreply@github.com>2016-08-25 17:08:49 +0100
commitd4b4eb62589ca9aa1918cd6ef436768668fe89ad (patch)
tree255a69f2c80464338799cc3a13e63824c1a9b1bb /lib
parentfba93c0595db24d19589cbe1ab6234aec4c61780 (diff)
parent7f6b92e88247739dd2ec6f47096b8e267021fa67 (diff)
downloadchef-d4b4eb62589ca9aa1918cd6ef436768668fe89ad.tar.gz
Merge pull request #5249 from evan2645/use-upstart-goal-state-as-service-status
Use upstart goal state as service status
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/provider/service/upstart.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/chef/provider/service/upstart.rb b/lib/chef/provider/service/upstart.rb
index 99ffc24653..6e2a3b6473 100644
--- a/lib/chef/provider/service/upstart.rb
+++ b/lib/chef/provider/service/upstart.rb
@@ -119,7 +119,7 @@ class Chef
end
else
begin
- if upstart_state == "running"
+ if upstart_goal_state == "start"
@current_resource.running true
else
@current_resource.running false
@@ -223,7 +223,7 @@ class Chef
conf.write_file
end
- def upstart_state
+ def upstart_goal_state
command = "/sbin/status #{@job}"
status = popen4(command) do |pid, stdin, stdout, stderr|
stdout.each_line do |line|
@@ -234,7 +234,7 @@ class Chef
# service (goal) state
line =~ UPSTART_STATE_FORMAT
data = Regexp.last_match
- return data[2]
+ return data[1]
end
end
end