chef-container 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/chef/container/version.rb +1 -1
- data/lib/chef/provider/service/container.rb +10 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82bc1bcdeba795d1a39aca62bc28bc36e001655a
|
4
|
+
data.tar.gz: dbcbe47207290a73c98ac994c24b57f415688491
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c4d6ad5f9f60b8a560ce237684066c35b2f66352f69cae7efd338f891963fecd7ca82bdf4de2a4c447c72af4f56dea2d4e31c06ef0c171a4145503ac8075ee5
|
7
|
+
data.tar.gz: 232ae2343b256746a081f64d59811b54101f7ed8748843f38453a9e2722615ad2d48cafcdf69331517b3c967646e77a3ea1193948f7e5d3b58e7c41d0ea33f95
|
@@ -33,6 +33,7 @@ class Chef
|
|
33
33
|
def initialize(*args)
|
34
34
|
super
|
35
35
|
@service_link = nil
|
36
|
+
@service_endpoint = sv_dir_name
|
36
37
|
@new_resource.supports[:status] = true
|
37
38
|
end
|
38
39
|
|
@@ -60,6 +61,7 @@ class Chef
|
|
60
61
|
def enable_service
|
61
62
|
Chef::Log.debug("Creating symlink in service_dir for #{new_resource.service_name}")
|
62
63
|
service_link.run_action(:create)
|
64
|
+
@service_endpoint = service_dir_name
|
63
65
|
|
64
66
|
Chef::Log.debug("waiting until named pipe #{service_dir_name}/supervise/ok exists.")
|
65
67
|
until ::FileTest.pipe?("#{service_dir_name}/supervise/ok")
|
@@ -75,35 +77,34 @@ class Chef
|
|
75
77
|
end
|
76
78
|
|
77
79
|
def disable_service
|
78
|
-
shell_out("#{Chef::Container::Runit::SV_BIN} down #{
|
80
|
+
shell_out("#{Chef::Container::Runit::SV_BIN} down #{service_dir_name}")
|
79
81
|
Chef::Log.debug("#{new_resource} down")
|
80
82
|
FileUtils.rm(service_dir_name)
|
81
83
|
Chef::Log.debug("#{new_resource} service symlink removed")
|
82
84
|
end
|
83
85
|
|
84
86
|
def start_service
|
85
|
-
if
|
86
|
-
shell_out!("#{Chef::Container::Runit::SV_BIN} start #{
|
87
|
+
if enabled?
|
88
|
+
shell_out!("#{Chef::Container::Runit::SV_BIN} start #{@service_endpoint}")
|
87
89
|
else
|
88
|
-
|
89
|
-
shell_out!("#{Chef::Container::Runit::RUNSV_BIN} #{service_dir_name} &")
|
90
|
+
shell_out!("#{Chef::Container::Runit::RUNSV_BIN} #{@service_endpoint} &")
|
90
91
|
end
|
91
92
|
end
|
92
93
|
|
93
94
|
def stop_service
|
94
|
-
shell_out!("#{Chef::Container::Runit::SV_BIN} stop #{
|
95
|
+
shell_out!("#{Chef::Container::Runit::SV_BIN} stop #{@service_endpoint}")
|
95
96
|
end
|
96
97
|
|
97
98
|
def restart_service
|
98
|
-
shell_out!("#{Chef::Container::Runit::SV_BIN} restart #{
|
99
|
+
shell_out!("#{Chef::Container::Runit::SV_BIN} restart #{@service_endpoint}")
|
99
100
|
end
|
100
101
|
|
101
102
|
def reload_service
|
102
|
-
shell_out!("#{Chef::Container::Runit::SV_BIN} force-reload #{
|
103
|
+
shell_out!("#{Chef::Container::Runit::SV_BIN} force-reload #{@service_endpoint}")
|
103
104
|
end
|
104
105
|
|
105
106
|
def running?
|
106
|
-
cmd = shell_out("#{Chef::Container::Runit::SV_BIN} status #{
|
107
|
+
cmd = shell_out("#{Chef::Container::Runit::SV_BIN} status #{@service_endpoint}")
|
107
108
|
(cmd.stdout =~ /^run:/ && cmd.exitstatus == 0)
|
108
109
|
end
|
109
110
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef-container
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Duffield
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chef
|