daemontools 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -42,6 +42,19 @@ module Daemontools
42
42
  run_svc(name, 't')
43
43
  end
44
44
 
45
+ def self.add_empty(name)
46
+ path = "#{@svc_root}/#{name}"
47
+ Dir.mkdir(path) unless Dir.exists?(path)
48
+ File.open("#{path}/down", 'w') {|f| f.write('')}
49
+ now = Time.now.to_f
50
+ while `sudo svstat #{path} 2>&1`.match(/unable to open/i)
51
+ raise "Timeout wait for svc add service" if Time.now.to_f - now > 10
52
+ sleep 0.1
53
+ end
54
+ stop(name)
55
+ true
56
+ end
57
+
45
58
  def self.add(name, command, options = {})
46
59
  @name = name
47
60
  @command = command
@@ -1,3 +1,3 @@
1
1
  module Daemontools
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: daemontools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-11-11 00:00:00.000000000 Z
12
+ date: 2013-12-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -79,7 +79,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
79
79
  version: '0'
80
80
  segments:
81
81
  - 0
82
- hash: -1940419418796993381
82
+ hash: -836446816853761681
83
83
  required_rubygems_version: !ruby/object:Gem::Requirement
84
84
  none: false
85
85
  requirements:
@@ -88,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
88
88
  version: '0'
89
89
  segments:
90
90
  - 0
91
- hash: -1940419418796993381
91
+ hash: -836446816853761681
92
92
  requirements: []
93
93
  rubyforge_project:
94
94
  rubygems_version: 1.8.24