daemons 1.1.5 → 1.1.6
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 +1 -1
- data/README +1 -1
- data/Rakefile +0 -0
- data/Releases +4 -0
- data/TODO +0 -0
- data/examples/call/call.rb +1 -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 +11 -4
- data/lib/daemons/application.rb +0 -0
- 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 +0 -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 +2 -2
data/LICENSE
CHANGED
data/README
CHANGED
data/Rakefile
CHANGED
File without changes
|
data/Releases
CHANGED
data/TODO
CHANGED
File without changes
|
data/examples/call/call.rb
CHANGED
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
@@ -27,7 +27,7 @@ require 'timeout'
|
|
27
27
|
# 2. <tt>Daemons.run_proc(app_name, options) { (...) }</tt>:
|
28
28
|
# This is used in wrapper-scripts that are supposed to control a proc.
|
29
29
|
# Control is completely passed to the daemons library.
|
30
|
-
# Such wrapper
|
30
|
+
# Such wrapper scripts need to be invoked with command line options like 'start' or 'stop'
|
31
31
|
# to do anything useful.
|
32
32
|
#
|
33
33
|
# 3. <tt>Daemons.call(options) { block }</tt>:
|
@@ -66,7 +66,7 @@ require 'timeout'
|
|
66
66
|
#
|
67
67
|
module Daemons
|
68
68
|
|
69
|
-
VERSION = "1.1.
|
69
|
+
VERSION = "1.1.6"
|
70
70
|
|
71
71
|
require 'daemons/daemonize'
|
72
72
|
|
@@ -81,7 +81,9 @@ module Daemons
|
|
81
81
|
# Please note that Daemons runs this script with <tt>load <script></tt>.
|
82
82
|
# Also note that Daemons cannot detect the directory in which the controlling
|
83
83
|
# script resides, so this has to be either an absolute path or you have to run
|
84
|
-
# the controlling script from the appropriate directory.
|
84
|
+
# the controlling script from the appropriate directory. Your script name should not
|
85
|
+
# end with _monitor because that name is reserved for a monitor process which is
|
86
|
+
# there to restart your daemon if it crashes.
|
85
87
|
#
|
86
88
|
# +options+:: A hash that may contain one or more of the options listed below
|
87
89
|
#
|
@@ -204,6 +206,8 @@ module Daemons
|
|
204
206
|
# Execute the block in a new daemon. <tt>Daemons.call</tt> will return immediately
|
205
207
|
# after spawning the daemon with the new Application object as a return value.
|
206
208
|
#
|
209
|
+
# +app_name+:: The name of the application.
|
210
|
+
#
|
207
211
|
# +options+:: A hash that may contain one or more of the options listed below
|
208
212
|
#
|
209
213
|
# +block+:: The block to call in the daemon.
|
@@ -218,6 +222,7 @@ module Daemons
|
|
218
222
|
#
|
219
223
|
# === Example:
|
220
224
|
# options = {
|
225
|
+
# :app_name => "myproc",
|
221
226
|
# :backtrace => true,
|
222
227
|
# :monitor => true,
|
223
228
|
# :ontop => true
|
@@ -239,7 +244,9 @@ module Daemons
|
|
239
244
|
options[:proc] = block
|
240
245
|
options[:mode] = :proc
|
241
246
|
|
242
|
-
|
247
|
+
options[:app_name] ||= 'proc'
|
248
|
+
|
249
|
+
@group ||= ApplicationGroup.new(options[:app_name], options)
|
243
250
|
|
244
251
|
new_app = @group.new_application(options)
|
245
252
|
new_app.start
|
data/lib/daemons/application.rb
CHANGED
File without changes
|
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
File without changes
|
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
|