poise-service-runit 1.0.0 → 1.1.0

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: 1bd16e05cea18fcda87a6943861f5648326131de
4
- data.tar.gz: 9ae59b4819183a0671d9407536ed8a045a75202a
3
+ metadata.gz: 7c209d895aa803d66524df70aa508a6b8fc9f007
4
+ data.tar.gz: 1fe211e400f1bd3bee1ec3119c5451deda1c64ba
5
5
  SHA512:
6
- metadata.gz: ffdab15e11cea62cf36c10cee2b006b45494e75eeaeec6fa79b9aff79d7c2780f86b9ff04d6664891542ffa541563175c04b38af76229f4d882eab2922fd8627
7
- data.tar.gz: 266ccae3d7d5e999523db0e076a887b241951414f47c1e79d096a6ad746ecc1f3556d4188533bbd607c78d03c5523e0e9cfe35152332e41ad77256da98ab2c89
6
+ metadata.gz: 5f0fd4f678f97595ab5338c629c2d9850e57ff0950aedb208443a7fd9645bbb664fcd459eb507a88a08a598e457e64de8ff273575fd17ff0531c6d73317def2a
7
+ data.tar.gz: cdf3134fc2645d899cb2252e476ab180e01c2b1f489856e07de1a38345c4d2a38418d6167440ee1984225c04aadc648885a2049b503b8dbf3a450d78e3c9d64a
data/.gitignore CHANGED
@@ -1,5 +1,11 @@
1
+ Gemfile.lock
2
+ Berksfile.lock
3
+ test/gemfiles/*.lock
1
4
  .kitchen/
2
5
  .kitchen.local.yml
3
- .vagrant/
4
6
  test/docker/
5
- Gemfile.lock
7
+ coverage/
8
+ pkg/
9
+ .yardoc/
10
+ doc/
11
+
data/Berksfile CHANGED
@@ -26,3 +26,8 @@ group :test do
26
26
  cookbook 'poise-service-runit_test', path: 'test/cookbooks/poise-service-runit_test'
27
27
  cookbook 'apt'
28
28
  end
29
+
30
+ # For the master build, pull in the runit cookbook from git.
31
+ if ENV['POISE_MASTER_BUILD']
32
+ cookbook 'runit', github: 'hw-cookbooks/runit', branch: 'develop'
33
+ end
@@ -0,0 +1,9 @@
1
+ # Poise-Service-Runit Changlog
2
+
3
+ ## v1.1.0
4
+
5
+ * Support for runit cookbook 1.7.
6
+
7
+ ## v1.0.0
8
+
9
+ * Initial release.
data/Gemfile CHANGED
@@ -18,10 +18,12 @@ source 'https://rubygems.org/'
18
18
 
19
19
  gemspec path: File.expand_path('..', __FILE__)
20
20
 
21
- def dev_gem(name, path: File.join('..', name))
21
+ def dev_gem(name, path: File.join('..', name), github: nil)
22
22
  path = File.expand_path(File.join('..', path), __FILE__)
23
23
  if File.exist?(path)
24
24
  gem name, path: path
25
+ elsif github
26
+ gem name, github: github
25
27
  end
26
28
  end
27
29
 
@@ -1,2 +1,2 @@
1
1
  #!/bin/sh
2
- exec svlogd -tt /var/log/<%= @options[:new_resource].service_name %>
2
+ exec svlogd -tt /var/log/<%= @options['new_resource'].service_name %>
@@ -1,8 +1,8 @@
1
1
  #!/bin/sh
2
2
  exec 2>&1
3
- cd <%= @options[:new_resource].directory %>
3
+ cd <%= @options['new_resource'].directory %>
4
4
  if [ -d "<%= File.join(@options['sv_dir'], @options['new_resource'].service_name, 'env') %>" ]; then
5
- exec chpst -u "<%= @options[:new_resource].user %>" -U "<%= @options[:new_resource].user %>" -e "<%= File.join(@options['sv_dir'], @options['new_resource'].service_name, 'env') %>" <%= @options[:new_resource].command %>
5
+ exec chpst -u "<%= @options['new_resource'].user %>" -U "<%= @options['new_resource'].user %>" -e "<%= File.join(@options['sv_dir'], @options['new_resource'].service_name, 'env') %>" <%= @options['new_resource'].command %>
6
6
  else
7
- exec chpst -u "<%= @options[:new_resource].user %>" -U "<%= @options[:new_resource].user %>" <%= @options[:new_resource].command %>
7
+ exec chpst -u "<%= @options['new_resource'].user %>" -U "<%= @options['new_resource'].user %>" <%= @options['new_resource'].command %>
8
8
  fi
@@ -16,6 +16,7 @@
16
16
 
17
17
  require 'chef/mash'
18
18
 
19
+ require 'poise_service/error'
19
20
  require 'poise_service/service_providers/base'
20
21
 
21
22
 
@@ -71,7 +72,14 @@ module PoiseService
71
72
 
72
73
  # Recipes to include for Runit.
73
74
  def recipes
74
- 'runit'
75
+ ['runit', proc {
76
+ begin
77
+ if node['virtualization'] && %w{docker lxc}.include?(node['virtualization']['system'])
78
+ resources('service[runsvdir-start]').action(:nothing)
79
+ end
80
+ rescue Chef::Exceptions::ResourceNotFound
81
+ end
82
+ }]
75
83
  end
76
84
 
77
85
  # Set up secondary service files for Runit.
@@ -86,6 +94,20 @@ module PoiseService
86
94
  end
87
95
  end
88
96
 
97
+ # Hack the enable action for the runit provider. This forces it to wait
98
+ # until runsv recognizes the new service. This is tracked upstream in
99
+ # https://github.com/hw-cookbooks/runit/issues/136
100
+ #
101
+ # @api private
102
+ # @todo Remove once the upstream bug is fixed.
103
+ def enable_service
104
+ super
105
+ sleep 1 until ::FileTest.pipe?("#{service_resource.service_dir}/#{service_resource.service_name}/supervise/ok")
106
+ if service_resource.log
107
+ sleep 1 until ::FileTest.pipe?("#{service_resource.service_dir}/#{service_resource.service_name}/log/supervise/ok")
108
+ end
109
+ end
110
+
89
111
  # Tear down secondary service files for Runit.
90
112
  def destroy_service
91
113
  # Disable automatically destroys the service with Runit.
@@ -99,9 +121,17 @@ module PoiseService
99
121
  #
100
122
  # @return [Class]
101
123
  def service_provider
102
- Class.new(Chef::Provider::Service::Runit) do
124
+ base_class = if defined?(Chef::Provider::RunitService)
125
+ Chef::Provider::RunitService
126
+ elsif defined?(Chef::Provider::Service::Runit)
127
+ Chef::Provider::Service::Runit
128
+ else
129
+ raise PoiseService::Error.new('Unable to find runit_service provider class.')
130
+ end
131
+ Class.new(base_class) do
132
+ # Lie about the name.
103
133
  def self.name
104
- 'Chef::Provider::Service::Runit'
134
+ superclass.name
105
135
  end
106
136
 
107
137
  def inside_docker?
@@ -17,6 +17,6 @@
17
17
 
18
18
  module PoiseService
19
19
  class Runit
20
- VERSION = '1.0.0'
20
+ VERSION = '1.1.0'
21
21
  end
22
22
  end
@@ -39,5 +39,5 @@ Gem::Specification.new do |spec|
39
39
 
40
40
  spec.add_development_dependency 'poise-boiler', '~> 1.0'
41
41
 
42
- spec.metadata['halite_dependencies'] = 'runit ~> 1.5'
42
+ spec.metadata['halite_dependencies'] = 'runit ~> 1.7'
43
43
  end
@@ -14,6 +14,8 @@
14
14
  # limitations under the License.
15
15
  #
16
16
 
17
+ require 'poise_service/resources/poise_service_test'
18
+
17
19
  poise_service_test 'runit' do
18
20
  service_provider :runit
19
21
  base_port 8000
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: poise-service-runit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Noah Kantrowitz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-22 00:00:00.000000000 Z
11
+ date: 2016-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: halite
@@ -78,6 +78,7 @@ files:
78
78
  - ".kitchen.yml"
79
79
  - ".travis.yml"
80
80
  - Berksfile
81
+ - CHANGELOG.md
81
82
  - Gemfile
82
83
  - LICENSE
83
84
  - README.md
@@ -116,7 +117,7 @@ homepage: https://github.com/poise/poise-service-runit
116
117
  licenses:
117
118
  - Apache 2.0
118
119
  metadata:
119
- halite_dependencies: runit ~> 1.5
120
+ halite_dependencies: runit ~> 1.7
120
121
  post_install_message:
121
122
  rdoc_options: []
122
123
  require_paths:
@@ -133,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
134
  version: '0'
134
135
  requirements: []
135
136
  rubyforge_project:
136
- rubygems_version: 2.4.5
137
+ rubygems_version: 2.4.8
137
138
  signing_key:
138
139
  specification_version: 4
139
140
  summary: An extension for poise-service to support runit.