poise-service-runit 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +5 -0
  3. data/.kitchen.travis.yml +9 -0
  4. data/.kitchen.yml +8 -0
  5. data/.travis.yml +22 -0
  6. data/Berksfile +28 -0
  7. data/Gemfile +31 -0
  8. data/LICENSE +201 -0
  9. data/README.md +38 -0
  10. data/Rakefile +17 -0
  11. data/chef/attributes/default.rb +18 -0
  12. data/chef/templates/sv-template-control-1.erb +2 -0
  13. data/chef/templates/sv-template-control-2.erb +2 -0
  14. data/chef/templates/sv-template-control-a.erb +2 -0
  15. data/chef/templates/sv-template-control-c.erb +2 -0
  16. data/chef/templates/sv-template-control-d.erb +6 -0
  17. data/chef/templates/sv-template-control-h.erb +5 -0
  18. data/chef/templates/sv-template-control-i.erb +2 -0
  19. data/chef/templates/sv-template-control-k.erb +2 -0
  20. data/chef/templates/sv-template-control-o.erb +2 -0
  21. data/chef/templates/sv-template-control-p.erb +2 -0
  22. data/chef/templates/sv-template-control-q.erb +2 -0
  23. data/chef/templates/sv-template-control-t.erb +6 -0
  24. data/chef/templates/sv-template-control-u.erb +2 -0
  25. data/chef/templates/sv-template-control-x.erb +2 -0
  26. data/chef/templates/sv-template-log-run.erb +2 -0
  27. data/chef/templates/sv-template-run.erb +8 -0
  28. data/lib/poise_service/runit/cheftie.rb +17 -0
  29. data/lib/poise_service/runit/provider.rb +191 -0
  30. data/lib/poise_service/runit/version.rb +22 -0
  31. data/lib/poise_service/runit.rb +27 -0
  32. data/poise-service-runit.gemspec +43 -0
  33. data/test/cookbooks/poise-service-runit_test/metadata.rb +18 -0
  34. data/test/cookbooks/poise-service-runit_test/recipes/default.rb +20 -0
  35. data/test/docker/docker.ca +29 -0
  36. data/test/docker/docker.pem +83 -0
  37. data/test/gemfiles/chef-12.gemfile +19 -0
  38. data/test/gemfiles/master.gemfile +23 -0
  39. data/test/integration/default/serverspec/Gemfile +19 -0
  40. data/test/integration/default/serverspec/default_spec.rb +21 -0
  41. metadata +149 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 1bd16e05cea18fcda87a6943861f5648326131de
4
+ data.tar.gz: 9ae59b4819183a0671d9407536ed8a045a75202a
5
+ SHA512:
6
+ metadata.gz: ffdab15e11cea62cf36c10cee2b006b45494e75eeaeec6fa79b9aff79d7c2780f86b9ff04d6664891542ffa541563175c04b38af76229f4d882eab2922fd8627
7
+ data.tar.gz: 266ccae3d7d5e999523db0e076a887b241951414f47c1e79d096a6ad746ecc1f3556d4188533bbd607c78d03c5523e0e9cfe35152332e41ad77256da98ab2c89
data/.gitignore ADDED
@@ -0,0 +1,5 @@
1
+ .kitchen/
2
+ .kitchen.local.yml
3
+ .vagrant/
4
+ test/docker/
5
+ Gemfile.lock
@@ -0,0 +1,9 @@
1
+ ---
2
+ driver:
3
+ name: docker
4
+ binary: "./docker"
5
+ socket: tcp://docker.poise.io:443
6
+ tls_verify: true
7
+ tls_cacert: test/docker/docker.ca
8
+ tls_cert: test/docker/docker.pem
9
+ tls_key: test/docker/docker.key
data/.kitchen.yml ADDED
@@ -0,0 +1,8 @@
1
+ ---
2
+ #<% require 'poise_boiler' %>
3
+ <%= PoiseBoiler.kitchen(platforms: 'linux') %>
4
+
5
+ suites:
6
+ - name: default
7
+ run_list:
8
+ - recipe[poise-service-runit_test]
data/.travis.yml ADDED
@@ -0,0 +1,22 @@
1
+ sudo: false
2
+ cache: bundler
3
+ language: ruby
4
+ addons:
5
+ apt:
6
+ packages:
7
+ - libgecode-dev
8
+ rvm:
9
+ - "2.2"
10
+ env:
11
+ global:
12
+ - USE_SYSTEM_GECODE=true
13
+ - KITCHEN_LOCAL_YAML=.kitchen.travis.yml
14
+ - secure: kNNXqspdcPM4GuCo7VNCzbIh/fN/aGqTx6WgIIS8F9irYPH2IIFtDbKHqlk0S4rfmzbOk5MmnzYrmm3h5YXAkzGs7314ktczkdl+S2wkRY2GqGJuXmMYwXwCwVTrLJjcJypW7x1s0o4/aY5QDqV2IBpBSrIPT/oBMG+VjjWI8PA=
15
+ - secure: y2w1rh3NEyAqV9ceIft2KDozYiPYM51G4i3tishT0Yupm0NPqg7ygX5C2O6Q8L2AR8I7WzXz2hp3vcvskmVTRyC+IIvMFxDUcsS4KVuFwR4wNBUVqETtKjg7b/SbAI5gpvnqVr8j0zrCQyVljUFzI1adPpe8NnKP6cxYZeSBX2g=
16
+ - secure: 7SgF1m1gD+l4KoYQVLdZeOfAwT+Q5d9vxv6191eFfn89AsYS6xs8F702PzmRGZis8ELX7O4akVucpDMXS3iUdZFIj0h5gCwRTaAPAdwYJmd4iRdDa2wr3ckT2WNS1E/kY7Nj0F6kgNagik+WS/tAXa7k4r04nKpJPCPDuLCr92s=
17
+ bundler_args: "--binstubs=$PWD/bin --jobs 3 --retry 3"
18
+ script:
19
+ - "./bin/rake travis"
20
+ gemfile:
21
+ - test/gemfiles/chef-12.gemfile
22
+ - test/gemfiles/master.gemfile
data/Berksfile ADDED
@@ -0,0 +1,28 @@
1
+ #
2
+ # Copyright 2015, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ source 'https://supermarket.chef.io/'
18
+ extension 'halite'
19
+
20
+ # Force the rebuild every time for development.
21
+ cookbook 'poise', gem: 'poise'
22
+ cookbook 'poise-service', gem: 'poise-service'
23
+ cookbook 'poise-service-runit', gem: 'poise-service-runit'
24
+
25
+ group :test do
26
+ cookbook 'poise-service-runit_test', path: 'test/cookbooks/poise-service-runit_test'
27
+ cookbook 'apt'
28
+ end
data/Gemfile ADDED
@@ -0,0 +1,31 @@
1
+ #
2
+ # Copyright 2015, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ source 'https://rubygems.org/'
18
+
19
+ gemspec path: File.expand_path('..', __FILE__)
20
+
21
+ def dev_gem(name, path: File.join('..', name))
22
+ path = File.expand_path(File.join('..', path), __FILE__)
23
+ if File.exist?(path)
24
+ gem name, path: path
25
+ end
26
+ end
27
+
28
+ dev_gem 'halite'
29
+ dev_gem 'poise'
30
+ dev_gem 'poise-boiler'
31
+ dev_gem 'poise-service'
data/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
data/README.md ADDED
@@ -0,0 +1,38 @@
1
+ # Poise Service Runit Cookbook
2
+
3
+ [![Build Status](https://img.shields.io/travis/poise/poise-service-runit.svg)](https://travis-ci.org/poise/poise-service-runit)
4
+ [![Gem Version](https://img.shields.io/gem/v/poise-service-runit.svg)](https://rubygems.org/gems/poise-service-runit)
5
+ [![Cookbook Version](https://img.shields.io/cookbook/v/poise-service-runit.svg)](https://supermarket.chef.io/cookbooks/poise-service-runit)
6
+ [![Coverage](https://img.shields.io/codecov/c/github/poise/poise-service-runit.svg)](https://codecov.io/github/poise/poise-service-runit)
7
+ [![Gemnasium](https://img.shields.io/gemnasium/poise/poise-service-runit.svg)](https://gemnasium.com/poise/poise-service-runit)
8
+ [![License](https://img.shields.io/badge/license-Apache_2-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)
9
+
10
+ A [Runit](http://smarden.org/runit/) provider for
11
+ [poise-service](https://github.com/poise/poise-service).
12
+
13
+ See [poise-service](https://github.com/poise/poise-service) for more information
14
+ about usage and configuration. Add `poise-service-runit` to a cookbook's
15
+ dependencies to enable the plugin. Once enabled, `:runit` will also be set as
16
+ the default service provider.
17
+
18
+ ## Sponsors
19
+
20
+ Development sponsored by [Bloomberg](http://www.bloomberg.com/company/technology/).
21
+
22
+ The Poise test server infrastructure is sponsored by [Rackspace](https://rackspace.com/).
23
+
24
+ ## License
25
+
26
+ Copyright 2015, Noah Kantrowitz
27
+
28
+ Licensed under the Apache License, Version 2.0 (the "License");
29
+ you may not use this file except in compliance with the License.
30
+ You may obtain a copy of the License at
31
+
32
+ http://www.apache.org/licenses/LICENSE-2.0
33
+
34
+ Unless required by applicable law or agreed to in writing, software
35
+ distributed under the License is distributed on an "AS IS" BASIS,
36
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
37
+ See the License for the specific language governing permissions and
38
+ limitations under the License.
data/Rakefile ADDED
@@ -0,0 +1,17 @@
1
+ #
2
+ # Copyright 2015, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ require 'poise_boiler/rakefile'
@@ -0,0 +1,18 @@
1
+ #
2
+ # Copyright 2015, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ # Set the default to be runit. This replaces the default default of 'auto'.
18
+ default['poise-service']['provider'] = 'runit'
@@ -0,0 +1,2 @@
1
+ #!/bin/sh
2
+ <%= @options['control']['1'] %>
@@ -0,0 +1,2 @@
1
+ #!/bin/sh
2
+ <%= @options['control']['2'] %>
@@ -0,0 +1,2 @@
1
+ #!/bin/sh
2
+ <%= @options['control']['a'] %>
@@ -0,0 +1,2 @@
1
+ #!/bin/sh
2
+ <%= @options['control']['c'] %>
@@ -0,0 +1,6 @@
1
+ #!/bin/sh
2
+ <%- if @options['control'] && @options['control']['d'] -%>
3
+ <%= @options['control']['d'] %>
4
+ <%- else -%>
5
+ <%= @options['sv_bin'] %> <%= @options['runit_signals'][@options['new_resource'].stop_signal] %> <%= File.join(@options['sv_dir'], @options['new_resource'].service_name) %>
6
+ <%- end -%>
@@ -0,0 +1,5 @@
1
+ #!/bin/sh
2
+ <%- if @options['control'] && @options['control']['h'] -%>
3
+ <%= @options['control']['h'] %>
4
+ <%- else -%>
5
+ <%= @options['sv_bin'] %> <%= @options['runit_signals'][@options['new_resource'].reload_signal] %> <%= File.join(@options['sv_dir'], @options['new_resource'].service_name) %><%- end -%>
@@ -0,0 +1,2 @@
1
+ #!/bin/sh
2
+ <%= @options['control']['i'] %>
@@ -0,0 +1,2 @@
1
+ #!/bin/sh
2
+ <%= @options['control']['k'] %>
@@ -0,0 +1,2 @@
1
+ #!/bin/sh
2
+ <%= @options['control']['o'] %>
@@ -0,0 +1,2 @@
1
+ #!/bin/sh
2
+ <%= @options['control']['p'] %>
@@ -0,0 +1,2 @@
1
+ #!/bin/sh
2
+ <%= @options['control']['q'] %>
@@ -0,0 +1,6 @@
1
+ #!/bin/sh
2
+ <%- if @options['control'] && @options['control']['t'] -%>
3
+ <%= @options['control']['t'] %>
4
+ <%- else -%>
5
+ <%= @options['sv_bin'] %> <%= @options['runit_signals'][@options['new_resource'].stop_signal] %> <%= File.join(@options['sv_dir'], @options['new_resource'].service_name) %>
6
+ <%- end -%>
@@ -0,0 +1,2 @@
1
+ #!/bin/sh
2
+ <%= @options['control']['u'] %>
@@ -0,0 +1,2 @@
1
+ #!/bin/sh
2
+ <%= @options['control']['x'] %>
@@ -0,0 +1,2 @@
1
+ #!/bin/sh
2
+ exec svlogd -tt /var/log/<%= @options[:new_resource].service_name %>
@@ -0,0 +1,8 @@
1
+ #!/bin/sh
2
+ exec 2>&1
3
+ cd <%= @options[:new_resource].directory %>
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 %>
6
+ else
7
+ exec chpst -u "<%= @options[:new_resource].user %>" -U "<%= @options[:new_resource].user %>" <%= @options[:new_resource].command %>
8
+ fi
@@ -0,0 +1,17 @@
1
+ #
2
+ # Copyright 2015, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ require 'poise_service/runit/provider'
@@ -0,0 +1,191 @@
1
+ #
2
+ # Copyright 2015, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ require 'chef/mash'
18
+
19
+ require 'poise_service/service_providers/base'
20
+
21
+
22
+ module PoiseService
23
+ module Runit
24
+ # Poise-service provider for [Runit](http://smarden.org/runit/index.html).
25
+ #
26
+ # @since 1.0.0
27
+ # @example
28
+ # poise_service 'myapp' do
29
+ # command 'myapp --serve'
30
+ # provider :runit
31
+ # end
32
+ class Provider < PoiseService::ServiceProviders::Base
33
+ provides(:runit)
34
+
35
+ # A mapping of signal names to sv subcommands.
36
+ RUNIT_SIGNALS = {
37
+ 'STOP' => 'pause',
38
+ 'CONT' => 'cont',
39
+ 'HUP' => 'hup',
40
+ 'ALRM' => 'alarm',
41
+ 'INT' => 'interrupt',
42
+ 'QUIT' => 'quit',
43
+ 'USR1' => '1',
44
+ 'USR2' => '2',
45
+ 'TERM' => 'term',
46
+ 'KILL' => 'kill',
47
+ }
48
+
49
+ # Reload action for the runit provider. Runs hup on the service resource
50
+ # because upstream's reload action runs sv force-reload which is ~restart.
51
+ def action_reload
52
+ return if options['never_reload']
53
+ notify_if_service do
54
+ service_resource.run_action(:hup)
55
+ end
56
+ end
57
+
58
+ # Parse the PID from sv output.
59
+ #
60
+ # @return [Integer]
61
+ def pid
62
+ cmd = shell_out(%w{sv status} + [new_resource.service_name])
63
+ if !cmd.error? && md = cmd.stdout.match(/run: #{new_resource.service_name}: \(pid (\d+)\)/)
64
+ md[1].to_i
65
+ else
66
+ nil
67
+ end
68
+ end
69
+
70
+ private
71
+
72
+ # Recipes to include for Runit.
73
+ def recipes
74
+ 'runit'
75
+ end
76
+
77
+ # Set up secondary service files for Runit.
78
+ def create_service
79
+ # Check signals here to be nice and abort early if possible.
80
+ check_signals!
81
+ # Enable automatically creates the service with Runit.
82
+ directory "/var/log/#{new_resource.service_name}" do
83
+ owner 'root'
84
+ group 'root'
85
+ mode '700'
86
+ end
87
+ end
88
+
89
+ # Tear down secondary service files for Runit.
90
+ def destroy_service
91
+ # Disable automatically destroys the service with Runit.
92
+ directory "/var/log/#{new_resource.service_name}" do
93
+ action :delete
94
+ recursive true
95
+ end
96
+ end
97
+
98
+ # Hack to subclass the upstream provider to override #inside_docker?
99
+ #
100
+ # @return [Class]
101
+ def service_provider
102
+ Class.new(Chef::Provider::Service::Runit) do
103
+ def self.name
104
+ 'Chef::Provider::Service::Runit'
105
+ end
106
+
107
+ def inside_docker?
108
+ # We account for docker already so just lock it to false.
109
+ false
110
+ end
111
+ end
112
+ end
113
+
114
+ # Create the service resource for Runit.
115
+ #
116
+ # @return [Chef::Resource]
117
+ def service_resource
118
+ # Sanity checking
119
+ check_signals!
120
+ run_dummy!
121
+ # Set defaults for sv_bin and sv_dir so we can use them in templates.
122
+ # This follows the same lookup as in resource_runit_service.rb.
123
+ if node['runit']
124
+ options['sv_bin'] ||= node['runit']['sv_bin']
125
+ options['sv_dir'] ||= node['runit']['sv_dir']
126
+ end
127
+ options['sv_bin'] ||= '/usr/bin/sv'
128
+ options['sv_dir'] ||= '/etc/sv'
129
+ # Build the runit_service resource.
130
+ @service_resource ||= Chef::Resource::RunitService.new(new_resource.name, run_context).tap do |r|
131
+ r.provider service_provider
132
+ r.service_name new_resource.service_name
133
+ r.owner 'root'
134
+ r.group 'root'
135
+ r.sv_bin options['sv_bin']
136
+ r.sv_dir options['sv_dir']
137
+ r.sv_timeout options['timeout'] if options['timeout']
138
+ r.options options.merge(new_resource: new_resource, runit_signals: RUNIT_SIGNALS)
139
+ r.env Mash.new(options['environment'] || new_resource.environment)
140
+ r.run_template_name 'template'
141
+ r.log_template_name 'template'
142
+ # Force h and t because those map to stop_signal and reload_signal.
143
+ control = []
144
+ control << 'h' if new_resource.reload_signal != 'HUP'
145
+ control += %w{d t} if new_resource.stop_signal != 'TERM'
146
+ control += options['control'].keys if options['control']
147
+ control.uniq!
148
+ r.control control
149
+ r.control_template_names Hash.new { 'template-control' } # There is no name only Zuul.
150
+ r.cookbook 'poise-service-runit'
151
+ # Runit only supports the equivalent of our 'immediately' mode :-/
152
+ r.restart_on_update new_resource.restart_on_update
153
+ end
154
+ end
155
+
156
+ def check_signals!
157
+ %w{reload_signal stop_signal}.each do |sig_type|
158
+ signal = new_resource.send(sig_type)
159
+ unless RUNIT_SIGNALS[signal]
160
+ raise PoiseService::Error.new("Runit does not support sending #{signal}, please change the #{sig_type} on #{new_resource.to_s}")
161
+ end
162
+ end
163
+ end
164
+
165
+ # Find the command to run run in dummy mode for testing inside docker.
166
+ # If this returns nil, no dummy service is started.
167
+ #
168
+ # @return [String, nil]
169
+ def dummy_command
170
+ return options['dummy_command'] if options.include?('dummy_command')
171
+ return nil unless node['virtualization'] && %w{docker lxc}.include?(node['virtualization']['system'])
172
+ node.value_for_platform_family(debian: '/usr/sbin/runsvdir-start', rhel: '/sbin/runsvdir -P -H /etc/service')
173
+ end
174
+
175
+ # HAXX: Deal with starting runsvdir under Docker on Ubuntu/Debian/RHEL.
176
+ # System packages use Upstart which doesn't run under Docker. Yo dawg.
177
+ #
178
+ # @return [void]
179
+ def run_dummy!
180
+ if dummy_command
181
+ Chef::Resource.resource_for_node(:poise_service, node).new('runsvdir', run_context).tap do |r|
182
+ r.command(dummy_command)
183
+ r.provider(:dummy)
184
+ r.run_action(:enable)
185
+ end
186
+ end
187
+ end
188
+
189
+ end
190
+ end
191
+ end
@@ -0,0 +1,22 @@
1
+ #
2
+ # Copyright 2015, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+
18
+ module PoiseService
19
+ class Runit
20
+ VERSION = '1.0.0'
21
+ end
22
+ end
@@ -0,0 +1,27 @@
1
+ #
2
+ # Copyright 2015, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+
18
+ module PoiseService
19
+ # A plugin for poise-service to manage
20
+ # [Runit](http://smarden.org/runit/index.html) services.
21
+ #
22
+ # @since 1.0.0
23
+ module Runit
24
+ autoload :Provider, 'poise_service/runit/provider'
25
+ autoload :VERSION, 'poise_service/runit/version'
26
+ end
27
+ end
@@ -0,0 +1,43 @@
1
+ #
2
+ # Copyright 2015, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ lib = File.expand_path('../lib', __FILE__)
18
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
19
+ require 'poise_service/runit/version'
20
+
21
+ Gem::Specification.new do |spec|
22
+ spec.name = 'poise-service-runit'
23
+ spec.version = PoiseService::Runit::VERSION
24
+ spec.authors = ['Noah Kantrowitz']
25
+ spec.email = %w{noah@coderanger.net}
26
+ spec.description = 'An extension for poise-service to support runit.'
27
+ spec.summary = spec.description
28
+ spec.homepage = 'https://github.com/poise/poise-service-runit'
29
+ spec.license = 'Apache 2.0'
30
+
31
+ spec.files = `git ls-files`.split($/)
32
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
33
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
34
+ spec.require_paths = %w{lib}
35
+
36
+ spec.add_dependency 'halite', '~> 1.0'
37
+ spec.add_dependency 'poise', '~> 2.0'
38
+ spec.add_dependency 'poise-service', '~> 1.0'
39
+
40
+ spec.add_development_dependency 'poise-boiler', '~> 1.0'
41
+
42
+ spec.metadata['halite_dependencies'] = 'runit ~> 1.5'
43
+ end
@@ -0,0 +1,18 @@
1
+ #
2
+ # Copyright 2015, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ name 'poise-service-runit_test'
18
+ depends 'poise-service-runit'
@@ -0,0 +1,20 @@
1
+ #
2
+ # Copyright 2015, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ poise_service_test 'runit' do
18
+ service_provider :runit
19
+ base_port 8000
20
+ end
@@ -0,0 +1,29 @@
1
+ -----BEGIN CERTIFICATE-----
2
+ MIIFCzCCAvOgAwIBAgIJAJTJgn9tSdKmMA0GCSqGSIb3DQEBBQUAMA0xCzAJBgNV
3
+ BAMTAkNBMB4XDTE1MDExMjIwMjk0M1oXDTI1MDEwOTIwMjk0M1owDTELMAkGA1UE
4
+ AxMCQ0EwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDDPFn79sz1kQLk
5
+ rAS5z/zfCMXuE+V9IEmGXJeSprsXrv+AdjFpVDr52lpvZ36i2gixk8grcWtFqQMC
6
+ jB1c2HUe69ebC89rHSPmGCx5eRcWQPQG29fdH/nC+I34EbYadJB7PdzkvTj0KuN8
7
+ YfQj6lhwqltYiELZhuGoXcuhwZ5SC4VcJ2cdvx7oQPECLlMft8dhWyk15WGhp0jL
8
+ 2H5noGajz9IFzHieoKJyh+oYA3BYCugpNBLTweNw+NuRxMwHixftvkXvlqKeZ402
9
+ 4iwmIO8MG9oUxXs6D85gv6tJOau+dD1EDYH9VzYwSvLto3QBzJX0NiHKlmeq4BG2
10
+ 1V3n+N1kZmMDgEtX2TDFsGHlUo77Gw0ob/w7qJU+7GAXRwWw7TPhMBLSkOlGM726
11
+ Lq9p5+7mK1YThk0PmlsSAU6/fT79PSdrYpTKr3WkBTnwd76df+Koh8fpN4BHf9L4
12
+ 9bWSYc9Nb9/wp0md9xhzjjVHargpVxZmNH7bcIa8YA9tYaW+oifo2hfb7o0qhGQ1
13
+ 8pES3LPUi/qtZkBYUQdh8/mkqTvRjeS446iUmYWcrHyiIzQk/cMbrAVYOi3Xnq0J
14
+ ui/r48iv7uLhpcDEQl2mENr0syygrPthVKa4gYHAZ0tK3pfe0yUG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YJ
18
+ KoZIhvcNAQEFBQADggIBAE7W1VSy+G+U6nIR3ryDMFwi0MddDj/hPUcKcmYTxXHQ
19
+ 4RepLLeKcrMOAfbx8EfPj1hxwr9qzYSxXh7A6VrpMnezPg1jB57gkmQM/7fGjDSx
20
+ jQ0kp15O/TTus/u058egm61HCZ/wwc5XqJ7z2uV8C3bOH3FW3nMmO67gi96XGJoG
21
+ YPXhlDjuKOBHSxx5X7sbVjFvG1QyP/1sjgidrNHvSk+In5z2qMWw9eRCtsZLP2tp
22
+ q8HAxhZLacOOOftRUTejERRL3hR/c3KkfW51/dwX81O/JeFh1XWtN+/Wc89b1QRC
23
+ 6miguLZKeq249q9Vv+EwHFDgEWSoO7HJWJLESNFtfIy0bAlmHmjtTs0sV2yqnodx
24
+ zCApGvXcSCzrLfqvri+HX8wWqbltlI2WpXwRGxd/ewGppt0lTBRekxLxp1AMABvc
25
+ 3pCaqivg+D3SBXllZhP7v02e+LEgodjVUaY0Em2jrq6l1EOzjVM7hA5yuNuvQsYw
26
+ bUlNZhLIej7IOdx7nvXCqioar6wKaXKhpBlhaoiYJsjqiAdDVVkaR60Rp4mjpuQz
27
+ Tbr+J3d/vR1ujbHiwx6BOdbnZhX3K7PFn97+sYogXU+IQQ7D9mqCvMUdAJtf6j2s
28
+ rw8ICV8DhZc0Ghnqi2BPZORQDc3kHIy6rMJtjNiibrLd6M8fYMLQRaIbtv50F/g3
29
+ -----END CERTIFICATE-----
30
+ -----BEGIN RSA PRIVATE KEY-----
31
+ Proc-Type: 4,ENCRYPTED
32
+ DEK-Info: AES-256-CBC,0459DAFB701C226AE019088F5C56BD63
33
+
34
+ ZPUrLB4WAERlNinOMaPaliRSjFpYsCAiX4M4kJBBDynKJPn+X9l55lGVmqqvNxFb
35
+ GrJST6B64llcOv4BnfYYPlWQNzMSRdjd2z+X84jMI96h3MRgfIgJspOT3R+YHUil
36
+ XwE/T02DJNGI2E7OpoQWoWutN205+PNraM63RtsyzJyBJS/7EAzqIqh7z52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+ #
2
+ # Copyright 2015, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
18
+
19
+ gem 'chef', '~> 12.0'
@@ -0,0 +1,23 @@
1
+ #
2
+ # Copyright 2015, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
18
+
19
+ gem 'chef', github: 'chef/chef'
20
+ gem 'halite', github: 'poise/halite'
21
+ gem 'poise', github: 'poise/poise'
22
+ gem 'poise-boiler', github: 'poise/poise-boiler'
23
+ gem 'poise-service', github: 'poise/poise-service'
@@ -0,0 +1,19 @@
1
+ #
2
+ # Copyright 2015, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ source 'https://rubygems.org/'
18
+
19
+ gem 'poise-service-spechelper'
@@ -0,0 +1,21 @@
1
+ #
2
+ # Copyright 2015, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ require 'poise_service/spec_helper'
18
+
19
+ describe 'runit provider' do
20
+ it_should_behave_like 'a poise_service_test', 'runit', 8000, false
21
+ end
metadata ADDED
@@ -0,0 +1,149 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: poise-service-runit
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Noah Kantrowitz
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-05-22 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: halite
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: poise
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '2.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: poise-service
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: poise-boiler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.0'
69
+ description: An extension for poise-service to support runit.
70
+ email:
71
+ - noah@coderanger.net
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".gitignore"
77
+ - ".kitchen.travis.yml"
78
+ - ".kitchen.yml"
79
+ - ".travis.yml"
80
+ - Berksfile
81
+ - Gemfile
82
+ - LICENSE
83
+ - README.md
84
+ - Rakefile
85
+ - chef/attributes/default.rb
86
+ - chef/templates/sv-template-control-1.erb
87
+ - chef/templates/sv-template-control-2.erb
88
+ - chef/templates/sv-template-control-a.erb
89
+ - chef/templates/sv-template-control-c.erb
90
+ - chef/templates/sv-template-control-d.erb
91
+ - chef/templates/sv-template-control-h.erb
92
+ - chef/templates/sv-template-control-i.erb
93
+ - chef/templates/sv-template-control-k.erb
94
+ - chef/templates/sv-template-control-o.erb
95
+ - chef/templates/sv-template-control-p.erb
96
+ - chef/templates/sv-template-control-q.erb
97
+ - chef/templates/sv-template-control-t.erb
98
+ - chef/templates/sv-template-control-u.erb
99
+ - chef/templates/sv-template-control-x.erb
100
+ - chef/templates/sv-template-log-run.erb
101
+ - chef/templates/sv-template-run.erb
102
+ - lib/poise_service/runit.rb
103
+ - lib/poise_service/runit/cheftie.rb
104
+ - lib/poise_service/runit/provider.rb
105
+ - lib/poise_service/runit/version.rb
106
+ - poise-service-runit.gemspec
107
+ - test/cookbooks/poise-service-runit_test/metadata.rb
108
+ - test/cookbooks/poise-service-runit_test/recipes/default.rb
109
+ - test/docker/docker.ca
110
+ - test/docker/docker.pem
111
+ - test/gemfiles/chef-12.gemfile
112
+ - test/gemfiles/master.gemfile
113
+ - test/integration/default/serverspec/Gemfile
114
+ - test/integration/default/serverspec/default_spec.rb
115
+ homepage: https://github.com/poise/poise-service-runit
116
+ licenses:
117
+ - Apache 2.0
118
+ metadata:
119
+ halite_dependencies: runit ~> 1.5
120
+ post_install_message:
121
+ rdoc_options: []
122
+ require_paths:
123
+ - lib
124
+ required_ruby_version: !ruby/object:Gem::Requirement
125
+ requirements:
126
+ - - ">="
127
+ - !ruby/object:Gem::Version
128
+ version: '0'
129
+ required_rubygems_version: !ruby/object:Gem::Requirement
130
+ requirements:
131
+ - - ">="
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
134
+ requirements: []
135
+ rubyforge_project:
136
+ rubygems_version: 2.4.5
137
+ signing_key:
138
+ specification_version: 4
139
+ summary: An extension for poise-service to support runit.
140
+ test_files:
141
+ - test/cookbooks/poise-service-runit_test/metadata.rb
142
+ - test/cookbooks/poise-service-runit_test/recipes/default.rb
143
+ - test/docker/docker.ca
144
+ - test/docker/docker.pem
145
+ - test/gemfiles/chef-12.gemfile
146
+ - test/gemfiles/master.gemfile
147
+ - test/integration/default/serverspec/Gemfile
148
+ - test/integration/default/serverspec/default_spec.rb
149
+ has_rdoc: