foreman_debian 0.1.1 → 0.1.2

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: 31b97a39895bf6b8730d3577f40f76caf3c2d653
4
- data.tar.gz: 2fe42c180f1a02bb5458777e2c73b6eb4ba69b5f
3
+ metadata.gz: 83f74357101041b2c90242449b2200e41454f246
4
+ data.tar.gz: 33b81a3cfbf5614e7e2cf7b614d1a243084644b2
5
5
  SHA512:
6
- metadata.gz: 11d7dc59dd978e495a26a9ea72e79770d8e679c2e13223b00f2f0d5c1bf2097aea76b5014c60385e6b51909ae4e95cbd877afb26488a0f75211f1aa176b96a41
7
- data.tar.gz: e0086bd5305dcff1d1b0f664e679d13a5a78dd15466c837fe934502fee26028c9d3224e9e3f9d2c15030601b77ec95ce37330564481fcb965cd94cac238ac9f6
6
+ metadata.gz: e12a07e83b269262ace8ef9e98f6f4d122c726ea1a6a577e71ef61f5f5345bce1ca93302a7dde98e6f635125bd1612372d261a7c9f68d55033f008ddab3850a1
7
+ data.tar.gz: fe42f9dd41f53bbefb58c5e4ea7592d21f56ca6581b550aab87f74dc57609f6e2beb2eb5f21c12bf9f4c038496ade30e612a893a3eb3555439dbb271600f3e50
@@ -33,10 +33,10 @@ module ForemanDebian
33
33
  threads = []
34
34
  each_file do |path|
35
35
  threads << Thread.new do
36
- exec_command("#{path.to_s} start")
36
+ start_process(path)
37
37
  @output.info " start #{path.to_s}"
38
38
  end
39
- exec_command("update-rc.d #{path.basename} defaults") if path.dirname.eql? @system_export_path
39
+ enable_start_process_on_boot(path)
40
40
  end
41
41
  ThreadsWait.all_waits(*threads)
42
42
  end
@@ -46,15 +46,32 @@ module ForemanDebian
46
46
  each_file do |path|
47
47
  @output.info " stop #{path.to_s}"
48
48
  threads << Thread.new do
49
- exec_command("#{path.to_s} stop")
49
+ stop_process(path)
50
50
  end
51
- exec_command("update-rc.d -f #{path.basename} remove") if path.dirname.eql? @system_export_path
51
+ disable_start_process_on_boot(path)
52
52
  end
53
53
  ThreadsWait.all_waits(*threads)
54
54
  end
55
55
 
56
+ def start_process(path)
57
+ exec_command("#{path.to_s} start")
58
+ end
59
+
60
+ def stop_process(path)
61
+ exec_command("#{path.to_s} stop")
62
+ end
63
+
64
+ def enable_start_process_on_boot(path)
65
+ exec_command("update-rc.d #{path.basename} defaults") if path.dirname.eql? @system_export_path
66
+ end
67
+
68
+ def disable_start_process_on_boot(path)
69
+ exec_command("update-rc.d -f #{path.basename} remove") if path.dirname.eql? @system_export_path
70
+ end
71
+
56
72
  def remove_file(path)
57
- stop_file(path)
73
+ stop_process(path)
74
+ disable_start_process_on_boot(path)
58
75
  super(path)
59
76
  end
60
77
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_debian
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - cargomedia
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-06-24 00:00:00.000000000 Z
12
+ date: 2015-09-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: clamp