daemons 1.1.4 → 1.1.5

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE CHANGED
File without changes
data/README CHANGED
@@ -1,4 +1,4 @@
1
- = Daemons Version 1.1.4
1
+ = Daemons Version 1.1.5
2
2
 
3
3
  (See Releases for release-specific information)
4
4
 
data/Rakefile CHANGED
File without changes
data/Releases CHANGED
@@ -1,5 +1,10 @@
1
1
  = Daemons Release History
2
2
 
3
+ == Release 1.1.5: December 19, 2011
4
+
5
+ * Catch the case where the pidfile is empty but not deleted
6
+ and restart the app (thanks to Rich Healey)
7
+
3
8
  == Release 1.1.4: June 17, 2011
4
9
 
5
10
  * Do not change the umask to 0000 when daemonizing anymore, just leave it as it
data/TODO CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -66,7 +66,7 @@ require 'timeout'
66
66
  #
67
67
  module Daemons
68
68
 
69
- VERSION = "1.1.4"
69
+ VERSION = "1.1.5"
70
70
 
71
71
  require 'daemons/daemonize'
72
72
 
@@ -320,10 +320,17 @@ module Daemons
320
320
  #
321
321
  # end
322
322
 
323
- def reload
324
- Process.kill('HUP', @pid.pid)
325
- rescue
326
- # ignore
323
+ def reload
324
+ if @pid.pid == 0
325
+ zap
326
+ start
327
+ else
328
+ begin
329
+ Process.kill('HUP', @pid.pid)
330
+ rescue
331
+ # ignore
332
+ end
333
+ end
327
334
  end
328
335
 
329
336
  # This is a nice little function for debugging purposes:
File without changes
File without changes
File without changes
File without changes
@@ -169,6 +169,9 @@ module Daemonize
169
169
  wr.write Process.pid
170
170
  wr.close
171
171
 
172
+ # Always handle INT signal (thanks to Vit Ondruch)
173
+ #trap 'INT', 'DEFAULT' # make sure we always handle the 'INT' signal
174
+
172
175
  $0 = app_name if app_name
173
176
 
174
177
  Dir.chdir "/" # Release old working directory
@@ -218,6 +221,9 @@ module Daemonize
218
221
  exit if pid = safefork
219
222
  #end
220
223
 
224
+ # Always handle INT signal (thanks to Vit Ondruch)
225
+ #trap 'INT', 'DEFAULT' # make sure we always handle the 'INT' signal
226
+
221
227
  $0 = app_name if app_name
222
228
 
223
229
  Dir.chdir "/" # Release old working directory
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
data/setup.rb CHANGED
File without changes
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: daemons
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
5
- prerelease:
4
+ prerelease: false
6
5
  segments:
7
6
  - 1
8
7
  - 1
9
- - 4
10
- version: 1.1.4
8
+ - 5
9
+ version: 1.1.5
11
10
  platform: ruby
12
11
  authors:
13
12
  - Thomas Uehlinger
@@ -15,7 +14,7 @@ autorequire:
15
14
  bindir: bin
16
15
  cert_chain: []
17
16
 
18
- date: 2011-06-17 00:00:00 -04:00
17
+ date: 2011-06-17 00:00:00 +02:00
19
18
  default_executable:
20
19
  dependencies: []
21
20
 
@@ -37,35 +36,35 @@ files:
37
36
  - LICENSE
38
37
  - setup.rb
39
38
  - lib/daemons.rb
40
- - lib/daemons/monitor.rb
39
+ - lib/daemons/application.rb
41
40
  - lib/daemons/application_group.rb
42
- - lib/daemons/etc_extension.rb
43
- - lib/daemons/daemonize.rb
41
+ - lib/daemons/change_privilege.rb
44
42
  - lib/daemons/cmdline.rb
45
43
  - lib/daemons/controller.rb
46
- - lib/daemons/change_privilege.rb
47
- - lib/daemons/application.rb
48
- - lib/daemons/pidmem.rb
44
+ - lib/daemons/daemonize.rb
45
+ - lib/daemons/etc_extension.rb
46
+ - lib/daemons/exceptions.rb
47
+ - lib/daemons/monitor.rb
49
48
  - lib/daemons/pid.rb
50
49
  - lib/daemons/pidfile.rb
51
- - lib/daemons/exceptions.rb
52
- - examples/run/ctrl_normal.rb
50
+ - lib/daemons/pidmem.rb
51
+ - examples/run/ctrl_crash.rb
52
+ - examples/run/ctrl_exec.rb
53
+ - examples/run/ctrl_exit.rb
54
+ - examples/run/ctrl_hanging.rb
55
+ - examples/run/ctrl_keep_pid_files.rb
53
56
  - examples/run/ctrl_monitor.rb
54
- - examples/run/ctrl_proc.rb
55
57
  - examples/run/ctrl_multiple.rb
58
+ - examples/run/ctrl_normal.rb
59
+ - examples/run/ctrl_ontop.rb
56
60
  - examples/run/ctrl_optionparser.rb
57
- - examples/run/myserver.rb
58
- - examples/run/myserver_hanging.rb
59
- - examples/run/ctrl_exit.rb
60
- - examples/run/myserver_crashing.rb
61
+ - examples/run/ctrl_proc.rb
61
62
  - examples/run/ctrl_proc_multiple.rb
62
- - examples/run/ctrl_keep_pid_files.rb
63
63
  - examples/run/ctrl_proc_simple.rb
64
- - examples/run/ctrl_ontop.rb
65
- - examples/run/ctrl_crash.rb
66
- - examples/run/ctrl_exec.rb
67
- - examples/run/ctrl_hanging.rb
64
+ - examples/run/myserver.rb
65
+ - examples/run/myserver_crashing.rb
68
66
  - examples/run/myserver_exiting.rb
67
+ - examples/run/myserver_hanging.rb
69
68
  - examples/call/call.rb
70
69
  - examples/call/call_monitor.rb
71
70
  - examples/daemonize/daemonize.rb
@@ -79,27 +78,23 @@ rdoc_options: []
79
78
  require_paths:
80
79
  - lib
81
80
  required_ruby_version: !ruby/object:Gem::Requirement
82
- none: false
83
81
  requirements:
84
82
  - - ">="
85
83
  - !ruby/object:Gem::Version
86
- hash: 3
87
84
  segments:
88
85
  - 0
89
86
  version: "0"
90
87
  required_rubygems_version: !ruby/object:Gem::Requirement
91
- none: false
92
88
  requirements:
93
89
  - - ">="
94
90
  - !ruby/object:Gem::Version
95
- hash: 3
96
91
  segments:
97
92
  - 0
98
93
  version: "0"
99
94
  requirements: []
100
95
 
101
96
  rubyforge_project: daemons
102
- rubygems_version: 1.6.2
97
+ rubygems_version: 1.3.6
103
98
  signing_key:
104
99
  specification_version: 2
105
100
  summary: A toolkit to create and control daemons in different ways