daemons 1.1.4 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/LICENSE +0 -0
- data/README +1 -1
- data/Rakefile +0 -0
- data/Releases +5 -0
- data/TODO +0 -0
- data/examples/call/call.rb +0 -0
- data/examples/call/call_monitor.rb +0 -0
- data/examples/daemonize/daemonize.rb +0 -0
- data/examples/run/ctrl_crash.rb +0 -0
- data/examples/run/ctrl_exec.rb +0 -0
- data/examples/run/ctrl_exit.rb +0 -0
- data/examples/run/ctrl_hanging.rb +0 -0
- data/examples/run/ctrl_keep_pid_files.rb +0 -0
- data/examples/run/ctrl_monitor.rb +0 -0
- data/examples/run/ctrl_multiple.rb +0 -0
- data/examples/run/ctrl_normal.rb +0 -0
- data/examples/run/ctrl_ontop.rb +0 -0
- data/examples/run/ctrl_optionparser.rb +0 -0
- data/examples/run/ctrl_proc.rb +0 -0
- data/examples/run/ctrl_proc_multiple.rb +0 -0
- data/examples/run/ctrl_proc_simple.rb +0 -0
- data/examples/run/myserver_crashing.rb +0 -0
- data/examples/run/myserver_exiting.rb +0 -0
- data/lib/daemons.rb +1 -1
- data/lib/daemons/application.rb +11 -4
- data/lib/daemons/application_group.rb +0 -0
- data/lib/daemons/change_privilege.rb +0 -0
- data/lib/daemons/cmdline.rb +0 -0
- data/lib/daemons/controller.rb +0 -0
- data/lib/daemons/daemonize.rb +6 -0
- data/lib/daemons/etc_extension.rb +0 -0
- data/lib/daemons/exceptions.rb +0 -0
- data/lib/daemons/monitor.rb +0 -0
- data/lib/daemons/pid.rb +0 -0
- data/lib/daemons/pidfile.rb +0 -0
- data/lib/daemons/pidmem.rb +0 -0
- data/setup.rb +0 -0
- metadata +23 -28
data/LICENSE
CHANGED
File without changes
|
data/README
CHANGED
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
|
data/examples/call/call.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
data/examples/run/ctrl_crash.rb
CHANGED
File without changes
|
data/examples/run/ctrl_exec.rb
CHANGED
File without changes
|
data/examples/run/ctrl_exit.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/examples/run/ctrl_normal.rb
CHANGED
File without changes
|
data/examples/run/ctrl_ontop.rb
CHANGED
File without changes
|
File without changes
|
data/examples/run/ctrl_proc.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/daemons.rb
CHANGED
data/lib/daemons/application.rb
CHANGED
@@ -320,10 +320,17 @@ module Daemons
|
|
320
320
|
#
|
321
321
|
# end
|
322
322
|
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
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
|
data/lib/daemons/cmdline.rb
CHANGED
File without changes
|
data/lib/daemons/controller.rb
CHANGED
File without changes
|
data/lib/daemons/daemonize.rb
CHANGED
@@ -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
|
data/lib/daemons/exceptions.rb
CHANGED
File without changes
|
data/lib/daemons/monitor.rb
CHANGED
File without changes
|
data/lib/daemons/pid.rb
CHANGED
File without changes
|
data/lib/daemons/pidfile.rb
CHANGED
File without changes
|
data/lib/daemons/pidmem.rb
CHANGED
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
|
-
|
5
|
-
prerelease:
|
4
|
+
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 1
|
8
7
|
- 1
|
9
|
-
-
|
10
|
-
version: 1.1.
|
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
|
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/
|
39
|
+
- lib/daemons/application.rb
|
41
40
|
- lib/daemons/application_group.rb
|
42
|
-
- lib/daemons/
|
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/
|
47
|
-
- lib/daemons/
|
48
|
-
- lib/daemons/
|
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/
|
52
|
-
- examples/run/
|
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/
|
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/
|
65
|
-
- examples/run/
|
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
|
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
|