chef-provider-service-daemontools 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8a601c02e621e78cf169ca585442ce6b548a52b1
4
- data.tar.gz: 56f20ec4515786b661edf1ed3c2af0b28d6af5ab
3
+ metadata.gz: 483f23aa36fb048a47012dbb64eb2a13e2d64e1f
4
+ data.tar.gz: f4fac77f2c013fe8a5d35009f0ed8b1853962b0a
5
5
  SHA512:
6
- metadata.gz: 6edf19d502619e776a6fa9386377a9f7a7d56431938e80b198847565487f64dc5b47660c0626e302fb76595eba6cb167e6741b077ab77105067642368be698c0
7
- data.tar.gz: 66d22b2914f685d9a0498d61212324bfbc293263e18d008c75fee583214ecd6d82b8a006dec987f80bf3e415db743b02faaae9efc3420693f6baa4d68ce1384c
6
+ metadata.gz: 7eccc9f9fc9a730f0efe3534beca5eadca70b92f27d5333c60d89e4090a5e8a199027d8c9e5a44a5f569c08dd775f6371bc8f4afe8acd773eec126b2b3ffeb0d
7
+ data.tar.gz: 8ddea04d15ec8be242dbe9c63002aff19909b665001b8ff15d60a06ad35c4df3ba6287e831f735b74869109d582265fa60554f5475522c69b29e5302a8b046f0
@@ -60,19 +60,27 @@ class Chef
60
60
  end
61
61
 
62
62
  def start_service
63
- shell_out!("#{@svc_command} -u #{@new_resource.service_dir}/#{@new_resource.service_name}")
63
+ if @current_resource.enabled && !@current_resource.running
64
+ shell_out!("#{@svc_command} -u #{@new_resource.service_dir}/#{@new_resource.service_name}")
65
+ end
64
66
  end
65
67
 
66
68
  def stop_service
67
- shell_out!("#{@svc_command} -d #{@new_resource.service_dir}/#{@new_resource.service_name}")
69
+ if @current_resource.enabled && @current_resource.running
70
+ shell_out!("#{@svc_command} -d #{@new_resource.service_dir}/#{@new_resource.service_name}")
71
+ end
68
72
  end
69
73
 
70
74
  def reload_service
71
- shell_out!("#{@svc_command} -h #{@new_resource.service_dir}/#{@new_resource.service_name}")
75
+ if @current_resource.enabled && @current_resource.running
76
+ shell_out!("#{@svc_command} -h #{@new_resource.service_dir}/#{@new_resource.service_name}")
77
+ end
72
78
  end
73
79
 
74
80
  def restart_service
75
- shell_out!("#{@svc_command} -t #{@new_resource.service_dir}/#{@new_resource.service_name}")
81
+ if @current_resource.enabled && @current_resource.running
82
+ shell_out!("#{@svc_command} -t #{@new_resource.service_dir}/#{@new_resource.service_name}")
83
+ end
76
84
  end
77
85
 
78
86
  def service_status!
@@ -81,6 +89,15 @@ class Chef
81
89
  @current_resource.enabled(true)
82
90
  status = shell_out!("#{@svstat_command} #{service_link}")
83
91
  if status.exitstatus == 0
92
+
93
+ retry_count = 4
94
+ while status.stdout =~ /: supervise not running/
95
+ sleep 1
96
+ retry_count -= 1
97
+ status = shell_out!("#{@svstat_command} #{service_link}")
98
+ break if retry_count < 0
99
+ end
100
+
84
101
  if status.stdout =~ /: up \(pid [1-9]/
85
102
  @current_resource.running(true)
86
103
  elsif status.stdout =~ /: down [1-9]/
@@ -2,7 +2,7 @@ class Chef
2
2
  class Provider
3
3
  class Service
4
4
  class Daemontools < Chef::Provider::Service
5
- VERSION = "1.0.0"
5
+ VERSION = "1.0.1"
6
6
  end
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-provider-service-daemontools
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - HIROSE Masaaki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-18 00:00:00.000000000 Z
11
+ date: 2014-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef
@@ -105,10 +105,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
105
  version: '0'
106
106
  requirements: []
107
107
  rubyforge_project:
108
- rubygems_version: 2.2.2
108
+ rubygems_version: 2.4.1
109
109
  signing_key:
110
110
  specification_version: 4
111
111
  summary: Chef's provider to manage service under daemontools.
112
112
  test_files:
113
113
  - spec/chef/provider/service/daemontools_spec.rb
114
114
  - spec/spec_helper.rb
115
+ has_rdoc: