[DRE-commits] [ruby-daemons] 01/07: Imported Upstream version 1.1.9
Jonas Genannt
jonas at brachium-system.net
Sat Nov 30 19:13:02 UTC 2013
This is an automated email from the git hooks/post-receive script.
hggh-guest pushed a commit to branch master
in repository ruby-daemons.
commit 06d88de9bd6bff547eafe980c3999fc99e1644ef
Author: Jonas Genannt <jonas at brachium-system.net>
Date: Sat Nov 30 19:56:02 2013 +0100
Imported Upstream version 1.1.9
---
LICENSE | 9 +-
README | 14 +-
Rakefile | 0
Releases | 19 ++
TODO | 0
examples/call/call.rb | 1 +
examples/call/call_monitor.rb | 0
examples/daemonize/daemonize.rb | 0
examples/run/ctrl_crash.rb | 0
examples/run/ctrl_exec.rb | 0
examples/run/ctrl_exit.rb | 0
examples/run/ctrl_hanging.rb | 0
examples/run/ctrl_keep_pid_files.rb | 0
examples/run/ctrl_monitor.rb | 0
examples/run/ctrl_multiple.rb | 0
examples/run/ctrl_normal.rb | 1 -
examples/run/ctrl_ontop.rb | 0
examples/run/ctrl_optionparser.rb | 0
examples/run/ctrl_proc.rb | 0
examples/run/ctrl_proc_multiple.rb | 0
examples/run/ctrl_proc_rand.rb | 23 +++
examples/run/ctrl_proc_simple.rb | 0
examples/run/{ctrl_hanging.rb => ctrl_slowstop.rb} | 7 +-
examples/run/myserver_crashing.rb | 0
examples/run/myserver_exiting.rb | 0
.../{myserver_crashing.rb => myserver_slowstop.rb} | 19 +-
lib/daemons.rb | 15 +-
lib/daemons/application.rb | 11 +-
lib/daemons/application_group.rb | 0
lib/daemons/change_privilege.rb | 0
lib/daemons/cmdline.rb | 0
lib/daemons/controller.rb | 0
lib/daemons/daemonize.rb | 211 ++++++---------------
lib/daemons/etc_extension.rb | 0
lib/daemons/exceptions.rb | 0
lib/daemons/monitor.rb | 0
lib/daemons/pid.rb | 1 -
lib/daemons/pidfile.rb | 0
lib/daemons/pidmem.rb | 0
metadata.yml | 71 ++++---
setup.rb | 0
41 files changed, 164 insertions(+), 238 deletions(-)
diff --git a/LICENSE b/LICENSE
old mode 100755
new mode 100644
index 6fa746d..4cfe8b9
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2005-2011 Thomas Uehlinger
+Copyright (c) 2005-2012 Thomas Uehlinger
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
@@ -20,10 +20,3 @@ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
-
-This license does not apply to daemonize.rb, which is was written by
-Travis Whitton und published under the following license:
-
-The Daemonize extension module is copywrited free software by Travis Whitton
-<whitton at atlantic.net>. You can redistribute it under the terms specified in
-the COPYING file of the Ruby distribution.
diff --git a/README b/README
old mode 100755
new mode 100644
index d8f4ec5..d3c6193
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-= Daemons Version 1.1.5
+= Daemons Version 1.1.9
(See Releases for release-specific information)
@@ -14,9 +14,6 @@ Besides this basic functionality, daemons offers many advanced features like <i>
and logging (in case your ruby script crashes) and <i>monitoring</i> and automatic restarting of your processes
if they crash.
-Daemons includes the <tt>daemonize.rb</tt> script written by <i>Travis Whitton</i> to do the daemonization
-process.
-
== Basic Usage
You can use Daemons in four different ways:
@@ -189,7 +186,7 @@ Anonymous SVN checkout is available with "svn checkout http://daemons.rubyforge.
== License
-Copyright (c) 2005-2010 Thomas Uehlinger
+Copyright (c) 2005-2012 Thomas Uehlinger
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
@@ -212,13 +209,6 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
-This license does not apply to daemonize.rb, which is was written by
-Travis Whitton und published under the following license:
-
-The Daemonize extension module is copywrited free software by Travis Whitton
-<whitton at atlantic.net>. You can redistribute it under the terms specified in
-the COPYING file of the Ruby distribution.
-
== Feedback and other resources
At http://rubyforge.org/projects/daemons.
diff --git a/Rakefile b/Rakefile
old mode 100755
new mode 100644
diff --git a/Releases b/Releases
old mode 100755
new mode 100644
index 3cca0fe..7b47920
--- a/Releases
+++ b/Releases
@@ -1,5 +1,24 @@
= Daemons Release History
+== Release 1.1.9: August 10, 2012
+
+* daemonize.rb: do srand in the forked child process both in daemonize and call_as_daemon
+ (thanks to Andrew Havens).
+
+== Release 1.1.8: February 7, 2012
+
+* rename to daemonization.rb to daemonize.rb (and Daemonization to Daemonize) to
+ ensure compatibility.
+
+== Release 1.1.7: February 6, 2012
+
+* start_proc: Write out the PID file in the newly created proc to avoid race conditions.
+* daemonize.rb: remove to simplify licensing (replaced by daemonization.rb).
+
+== Release 1.1.6: January 18, 2012
+
+* Add the :app_name option for the "call" daemonization mode.
+
== Release 1.1.5: December 19, 2011
* Catch the case where the pidfile is empty but not deleted
diff --git a/TODO b/TODO
old mode 100755
new mode 100644
diff --git a/examples/call/call.rb b/examples/call/call.rb
old mode 100755
new mode 100644
index 0738cf5..38fb639
--- a/examples/call/call.rb
+++ b/examples/call/call.rb
@@ -18,6 +18,7 @@ testfile = File.expand_path(__FILE__) + '.log'
#
options = {
+ :app_name => 'mytask',
# :ontop => true,
:multiple => true
}
diff --git a/examples/call/call_monitor.rb b/examples/call/call_monitor.rb
old mode 100755
new mode 100644
diff --git a/examples/daemonize/daemonize.rb b/examples/daemonize/daemonize.rb
old mode 100755
new mode 100644
diff --git a/examples/run/ctrl_crash.rb b/examples/run/ctrl_crash.rb
old mode 100755
new mode 100644
diff --git a/examples/run/ctrl_exec.rb b/examples/run/ctrl_exec.rb
old mode 100755
new mode 100644
diff --git a/examples/run/ctrl_exit.rb b/examples/run/ctrl_exit.rb
old mode 100755
new mode 100644
diff --git a/examples/run/ctrl_hanging.rb b/examples/run/ctrl_hanging.rb
old mode 100755
new mode 100644
diff --git a/examples/run/ctrl_keep_pid_files.rb b/examples/run/ctrl_keep_pid_files.rb
old mode 100755
new mode 100644
diff --git a/examples/run/ctrl_monitor.rb b/examples/run/ctrl_monitor.rb
old mode 100755
new mode 100644
diff --git a/examples/run/ctrl_multiple.rb b/examples/run/ctrl_multiple.rb
old mode 100755
new mode 100644
diff --git a/examples/run/ctrl_normal.rb b/examples/run/ctrl_normal.rb
old mode 100755
new mode 100644
index 2b6517d..8fc8abf
--- a/examples/run/ctrl_normal.rb
+++ b/examples/run/ctrl_normal.rb
@@ -8,5 +8,4 @@ end
require 'daemons'
-
Daemons.run(File.join(File.dirname(__FILE__), 'myserver.rb'))
diff --git a/examples/run/ctrl_ontop.rb b/examples/run/ctrl_ontop.rb
old mode 100755
new mode 100644
diff --git a/examples/run/ctrl_optionparser.rb b/examples/run/ctrl_optionparser.rb
old mode 100755
new mode 100644
diff --git a/examples/run/ctrl_proc.rb b/examples/run/ctrl_proc.rb
old mode 100755
new mode 100644
diff --git a/examples/run/ctrl_proc_multiple.rb b/examples/run/ctrl_proc_multiple.rb
old mode 100755
new mode 100644
diff --git a/examples/run/ctrl_proc_rand.rb b/examples/run/ctrl_proc_rand.rb
new file mode 100644
index 0000000..66ae95f
--- /dev/null
+++ b/examples/run/ctrl_proc_rand.rb
@@ -0,0 +1,23 @@
+lib_dir = File.expand_path(File.join(File.dirname(__FILE__), '../../lib'))
+
+if File.exist?(File.join(lib_dir, 'daemons.rb'))
+ $LOAD_PATH.unshift lib_dir
+else
+ begin; require 'rubygems'; rescue ::Exception; end
+end
+
+
+require 'daemons'
+
+
+Daemons.run_proc('myscript') do
+ loop do
+ file = File.open('/tmp/myscript.log', 'a')
+ file.write(Random.rand) # breaks without seeding
+ # file.write(Random.new.rand) # works without seeding
+ # file.write(rand) # also works, but this is Kernel.rand() so its different
+ file.write("\n")
+ file.close()
+ sleep 2
+ end
+end
\ No newline at end of file
diff --git a/examples/run/ctrl_proc_simple.rb b/examples/run/ctrl_proc_simple.rb
old mode 100755
new mode 100644
diff --git a/examples/run/ctrl_hanging.rb b/examples/run/ctrl_slowstop.rb
old mode 100755
new mode 100644
similarity index 64%
copy from examples/run/ctrl_hanging.rb
copy to examples/run/ctrl_slowstop.rb
index f5cb66d..50ff1e1
--- a/examples/run/ctrl_hanging.rb
+++ b/examples/run/ctrl_slowstop.rb
@@ -9,11 +9,8 @@ end
require 'daemons'
options = {
- #:mode => :exec,
- :multiple => true,
- :no_pidfiles => true,
- :force_kill_waittime => 5
+ #:force_kill_waittime => 40
#:force_kill_waittime => -1 # do not wait before killing -9
}
-Daemons.run(File.join(File.dirname(__FILE__), 'myserver_hanging.rb'), options)
+Daemons.run(File.join(File.dirname(__FILE__), 'myserver_slowstop.rb'), options)
diff --git a/examples/run/myserver_crashing.rb b/examples/run/myserver_crashing.rb
old mode 100755
new mode 100644
diff --git a/examples/run/myserver_exiting.rb b/examples/run/myserver_exiting.rb
old mode 100755
new mode 100644
diff --git a/examples/run/myserver_crashing.rb b/examples/run/myserver_slowstop.rb
similarity index 50%
copy from examples/run/myserver_crashing.rb
copy to examples/run/myserver_slowstop.rb
index f158e7b..d4317b0 100755
--- a/examples/run/myserver_crashing.rb
+++ b/examples/run/myserver_slowstop.rb
@@ -1,14 +1,21 @@
-# This is myserver.rb, an example server that is to be controlled by daemons
+#!/usr/bin/env ruby
+
+
+# This is myserver_slowstop.rb, an example server that is to be controlled by daemons
# and that does nothing really useful at the moment.
#
# Don't run this script by yourself, it can be controlled by the ctrl*.rb scripts.
+trap('TERM') {
+ puts "received TERM"
+
+ # simulate the slow stopping
+ sleep(10)
+
+ exit
+}
+
loop do
puts 'ping from myserver.rb!'
- puts 'this example server will crash in 3 seconds...'
-
sleep(3)
-
- puts 'CRASH!'
- raise 'CRASH!'
end
diff --git a/lib/daemons.rb b/lib/daemons.rb
old mode 100755
new mode 100644
index 8924e19..2aadd60
--- a/lib/daemons.rb
+++ b/lib/daemons.rb
@@ -27,7 +27,7 @@ require 'timeout'
# 2. <tt>Daemons.run_proc(app_name, options) { (...) }</tt>:
# This is used in wrapper-scripts that are supposed to control a proc.
# Control is completely passed to the daemons library.
-# Such wrapper script need to be invoked with command line options like 'start' or 'stop'
+# Such wrapper scripts need to be invoked with command line options like 'start' or 'stop'
# to do anything useful.
#
# 3. <tt>Daemons.call(options) { block }</tt>:
@@ -66,7 +66,7 @@ require 'timeout'
#
module Daemons
- VERSION = "1.1.5"
+ VERSION = "1.1.9"
require 'daemons/daemonize'
@@ -81,7 +81,9 @@ module Daemons
# Please note that Daemons runs this script with <tt>load <script></tt>.
# Also note that Daemons cannot detect the directory in which the controlling
# script resides, so this has to be either an absolute path or you have to run
- # the controlling script from the appropriate directory.
+ # the controlling script from the appropriate directory. Your script name should not
+ # end with _monitor because that name is reserved for a monitor process which is
+ # there to restart your daemon if it crashes.
#
# +options+:: A hash that may contain one or more of the options listed below
#
@@ -204,6 +206,8 @@ module Daemons
# Execute the block in a new daemon. <tt>Daemons.call</tt> will return immediately
# after spawning the daemon with the new Application object as a return value.
#
+ # +app_name+:: The name of the application.
+ #
# +options+:: A hash that may contain one or more of the options listed below
#
# +block+:: The block to call in the daemon.
@@ -218,6 +222,7 @@ module Daemons
#
# === Example:
# options = {
+ # :app_name => "myproc",
# :backtrace => true,
# :monitor => true,
# :ontop => true
@@ -239,7 +244,9 @@ module Daemons
options[:proc] = block
options[:mode] = :proc
- @group ||= ApplicationGroup.new('proc', options)
+ options[:app_name] ||= 'proc'
+
+ @group ||= ApplicationGroup.new(options[:app_name], options)
new_app = @group.new_application(options)
new_app.start
diff --git a/lib/daemons/application.rb b/lib/daemons/application.rb
old mode 100755
new mode 100644
index 8effb9b..0821f15
--- a/lib/daemons/application.rb
+++ b/lib/daemons/application.rb
@@ -1,6 +1,7 @@
require 'daemons/pidfile'
require 'daemons/pidmem'
require 'daemons/change_privilege'
+require 'daemons/daemonize'
require 'timeout'
@@ -206,6 +207,9 @@ module Daemons
return unless p = options[:proc]
myproc = proc do
+
+ @pid.pid = Process.pid
+
# We need this to remove the pid-file if the applications exits by itself.
# Note that <tt>at_text</tt> will only be run if the applications exits by calling
# <tt>exit</tt>, and not if it calls <tt>exit!</tt> (so please don't call <tt>exit!</tt>
@@ -246,17 +250,17 @@ module Daemons
end
}
+ started()
+
p.call()
end
unless options[:ontop]
- @pid.pid = Daemonize.call_as_daemon(myproc, output_logfile, @group.app_name)
+ Daemonize.call_as_daemon(myproc, output_logfile, @group.app_name)
else
Daemonize.simulate(output_logfile)
- @pid.pid = Process.pid
-
myproc.call
# why did we use this??
@@ -273,7 +277,6 @@ module Daemons
# end
end
- started()
end
diff --git a/lib/daemons/application_group.rb b/lib/daemons/application_group.rb
old mode 100755
new mode 100644
diff --git a/lib/daemons/change_privilege.rb b/lib/daemons/change_privilege.rb
old mode 100755
new mode 100644
diff --git a/lib/daemons/cmdline.rb b/lib/daemons/cmdline.rb
old mode 100755
new mode 100644
diff --git a/lib/daemons/controller.rb b/lib/daemons/controller.rb
old mode 100755
new mode 100644
diff --git a/lib/daemons/daemonize.rb b/lib/daemons/daemonize.rb
old mode 100755
new mode 100644
index 9133a09..fe8603c
--- a/lib/daemons/daemonize.rb
+++ b/lib/daemons/daemonize.rb
@@ -1,97 +1,5 @@
-#--
-###############################################################################
-# daemonize.rb is a slightly modified version of daemonize.rb was #
-# from the Daemonize Library written by Travis Whitton #
-# for details, read the notice below #
-###############################################################################
-#++
-#
-#
-# =Daemonize Library
-#
-# February. 4, 2005 Travis Whitton <whitton at atlantic.net>
-#
-# Daemonize allows you to easily modify any existing Ruby program to run
-# as a daemon. See README.rdoc for more details.
-#
-# == How to install
-# 1. su to root
-# 2. ruby install.rb
-# build the docs if you want to
-# 3. rdoc --main README.rdoc daemonize.rb README.rdoc
-#
-# == Copying
-# The Daemonize extension module is copywrited free software by Travis Whitton
-# <whitton at atlantic.net>. You can redistribute it under the terms specified in
-# the COPYING file of the Ruby distribution.
-#
-# == WARRANTY
-# THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
-# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE.
-#
-#
-# ----
-#
-# == Purpose
-#
-# Daemonize is a module derived from Perl's Proc::Daemon module. This module
-# allows you to easily modify any existing Ruby program to run as a daemon.
-# A daemon is a process that runs in the background with no controlling terminal.
-# Generally servers (like FTP and HTTP servers) run as daemon processes.
-# Note, do not make the mistake that a daemon == server. Converting a program
-# to a daemon by hand is a relatively simple process; however, this module will
-# save you the effort of repeatedly looking up the procedure, and it will also
-# insure that your programs are daemonized in the safest and most corrects
-# fashion possible.
-#
-# == Procedure
-#
-# The Daemonize module does the following:
-#
-# Forks a child and exits the parent process.
-#
-# Becomes a session leader (which detaches the program from
-# the controlling terminal).
-#
-# Forks another child process and exits first child. This prevents
-# the potential of acquiring a controlling terminal.
-#
-# Changes the current working directory to "/".
-#
-# Clears the file creation mask.
-#
-# Closes file descriptors.
-#
-# == Example usage
-#
-# Using the Daemonize module is extremely simple:
-#
-# require 'daemonize'
-#
-# class TestDaemon
-# include Daemonize
-#
-# def initialize
-# daemonize()
-# loop do
-# # do some work here
-# end
-# end
-# end
-#
-# == Credits
-#
-# Daemonize was written by Travis Whitton and is based on Perl's
-# Proc::Daemonize, which was written by Earl Hood. The above documentation
-# is also partially borrowed from the Proc::Daemonize POD documentation.
-
-
-
module Daemonize
- VERSION = "0.1.1m"
-
+
# Try to fork if at all possible retrying every 5 sec if the
# maximum process limit for the system has been reached
def safefork
@@ -112,37 +20,29 @@ module Daemonize
module_function :safefork
+ # Simulate the daemonization process (:ontop mode)
+ # NOTE: STDOUT and STDERR will not be redirected to the logfile,
+ # because in :ontop mode, we normally want to see the output
def simulate(logfile_name = nil)
- # NOTE: STDOUT and STDERR will not be redirected to the logfile, because in :ontop mode, we normally want to see the output
-
- Dir.chdir "/" # Release old working directory
+ # Release old working directory
+ Dir.chdir "/"
- # Make sure all file descriptors are closed
- ObjectSpace.each_object(IO) do |io|
- unless [STDIN, STDOUT, STDERR].include?(io)
- begin
- unless io.closed?
- io.close
- end
- rescue ::Exception
- end
- end
- end
+ close_io()
- # Free file descriptors and
- # point them somewhere sensible
- # STDOUT/STDERR should go to a logfile
-
+ # Free STDIN and point them somewhere sensible
begin; STDIN.reopen "/dev/null"; rescue ::Exception; end
end
module_function :simulate
+ # Call a given block as a daemon
def call_as_daemon(block, logfile_name = nil, app_name = nil)
+ # we use a pipe to return the PID of the daemon
rd, wr = IO.pipe
if tmppid = safefork
- # parent
+ # in the parent
+
wr.close
pid = rd.read.to_i
rd.close
@@ -151,7 +51,7 @@ module Daemonize
return pid
else
- # child
+ # in the child
rd.close
@@ -161,42 +61,24 @@ module Daemonize
end
# Prevent the possibility of acquiring a controlling terminal
- #if oldmode.zero?
- trap 'SIGHUP', 'IGNORE'
- exit if pid = safefork
- #end
+ trap 'SIGHUP', 'IGNORE'
+ exit if pid = safefork
wr.write Process.pid
wr.close
- # Always handle INT signal (thanks to Vit Ondruch)
- #trap 'INT', 'DEFAULT' # make sure we always handle the 'INT' signal
-
$0 = app_name if app_name
- Dir.chdir "/" # Release old working directory
+ # Release old working directory
+ Dir.chdir "/"
- # Make sure all file descriptors are closed
- ObjectSpace.each_object(IO) do |io|
- unless [STDIN, STDOUT, STDERR].include?(io)
- begin
- unless io.closed?
- io.close
- end
- rescue ::Exception
- end
- end
- end
-
- ios = Array.new(8192){|i| IO.for_fd(i) rescue nil}.compact
- ios.each do |io|
- next if io.fileno < 3
- io.close
- end
+ close_io()
-
redirect_io(logfile_name)
+ # Split rand streams between spawning and daemonized process
+ srand
+
block.call
exit
@@ -205,10 +87,10 @@ module Daemonize
module_function :call_as_daemon
- # This method causes the current running process to become a daemon
+ # Transform the current process into a daemon
def daemonize(logfile_name = nil, app_name = nil)
- srand # Split rand streams between spawning and daemonized process
- safefork and exit # Fork and exit from the parent
+ # Fork and exit from the parent
+ safefork and exit
# Detach from the controlling terminal
unless sess_id = Process.setsid
@@ -216,19 +98,29 @@ module Daemonize
end
# Prevent the possibility of acquiring a controlling terminal
- #if oldmode.zero?
- trap 'SIGHUP', 'IGNORE'
- exit if pid = safefork
- #end
-
- # Always handle INT signal (thanks to Vit Ondruch)
- #trap 'INT', 'DEFAULT' # make sure we always handle the 'INT' signal
+ trap 'SIGHUP', 'IGNORE'
+ exit if pid = safefork
$0 = app_name if app_name
- Dir.chdir "/" # Release old working directory
+ # Release old working directory
+ Dir.chdir "/"
+
+ close_io()
- # Make sure all file descriptors are closed
+ redirect_io(logfile_name)
+
+ # Split rand streams between spawning and daemonized process
+ srand
+
+ return sess_id
+ end
+ module_function :daemonize
+
+
+ def close_io()
+ # Make sure all input/output streams are closed
+ # Part I: close all IO objects (except for STDIN/STDOUT/STDERR)
ObjectSpace.each_object(IO) do |io|
unless [STDIN, STDOUT, STDERR].include?(io)
begin
@@ -239,18 +131,20 @@ module Daemonize
end
end
end
-
- redirect_io(logfile_name)
- #return oldmode ? sess_id : 0 # Return value is mostly irrelevant
- return sess_id
+ # Make sure all input/output streams are closed
+ # Part II: close all file decriptors (except for STDIN/STDOUT/STDERR)
+ ios = Array.new(8192) {|i| IO.for_fd(i) rescue nil}.compact
+ ios.each do |io|
+ next if io.fileno < 3
+ io.close
+ end
end
- module_function :daemonize
+ module_function :close_io
- # Free file descriptors and
+ # Free STDIN/STDOUT/STDERR file descriptors and
# point them somewhere sensible
- # STDOUT/STDERR should go to a logfile
def redirect_io(logfile_name)
begin; STDIN.reopen "/dev/null"; rescue ::Exception; end
@@ -271,4 +165,5 @@ module Daemonize
end
module_function :redirect_io
+
end
diff --git a/lib/daemons/etc_extension.rb b/lib/daemons/etc_extension.rb
old mode 100755
new mode 100644
diff --git a/lib/daemons/exceptions.rb b/lib/daemons/exceptions.rb
old mode 100755
new mode 100644
diff --git a/lib/daemons/monitor.rb b/lib/daemons/monitor.rb
old mode 100755
new mode 100644
diff --git a/lib/daemons/pid.rb b/lib/daemons/pid.rb
old mode 100755
new mode 100644
index d76a5e0..dfc2dfd
--- a/lib/daemons/pid.rb
+++ b/lib/daemons/pid.rb
@@ -1,4 +1,3 @@
-require 'open3'
module Daemons
diff --git a/lib/daemons/pidfile.rb b/lib/daemons/pidfile.rb
old mode 100755
new mode 100644
diff --git a/lib/daemons/pidmem.rb b/lib/daemons/pidmem.rb
old mode 100755
new mode 100644
diff --git a/metadata.yml b/metadata.yml
index 54595f7..65adcfb 100644
--- a/metadata.yml
+++ b/metadata.yml
@@ -1,34 +1,31 @@
---- !ruby/object:Gem::Specification
+--- !ruby/object:Gem::Specification
name: daemons
-version: !ruby/object:Gem::Version
- prerelease: false
- segments:
- - 1
- - 1
- - 5
- version: 1.1.5
+version: !ruby/object:Gem::Version
+ version: 1.1.9
+ prerelease:
platform: ruby
-authors:
+authors:
- Thomas Uehlinger
autorequire:
bindir: bin
cert_chain: []
-
-date: 2011-06-17 00:00:00 +02:00
-default_executable:
+date: 2012-08-10 00:00:00.000000000 Z
dependencies: []
-
-description: Daemons provides an easy way to wrap existing ruby scripts (for example a self-written server) to be run as a daemon and to be controlled by simple start/stop/restart commands. You can also call blocks as daemons and control them from the parent or just daemonize the current process. Besides this basic functionality, daemons offers many advanced features like exception backtracing and logging (in case your ruby script crashes) and monitoring and automatic restarting of y [...]
+description: Daemons provides an easy way to wrap existing ruby scripts (for example
+ a self-written server) to be run as a daemon and to be controlled by simple start/stop/restart
+ commands. You can also call blocks as daemons and control them from the parent
+ or just daemonize the current process. Besides this basic functionality, daemons
+ offers many advanced features like exception backtracing and logging (in case your
+ ruby script crashes) and monitoring and automatic restarting of your processes if
+ they crash.
email: th.uehlinger at gmx.ch
executables: []
-
extensions: []
-
-extra_rdoc_files:
+extra_rdoc_files:
- README
- Releases
- TODO
-files:
+files:
- Rakefile
- Releases
- TODO
@@ -60,43 +57,39 @@ files:
- examples/run/ctrl_optionparser.rb
- examples/run/ctrl_proc.rb
- examples/run/ctrl_proc_multiple.rb
+- examples/run/ctrl_proc_rand.rb
- examples/run/ctrl_proc_simple.rb
+- examples/run/ctrl_slowstop.rb
- examples/run/myserver.rb
- examples/run/myserver_crashing.rb
- examples/run/myserver_exiting.rb
- examples/run/myserver_hanging.rb
+- examples/run/myserver_slowstop.rb
- examples/call/call.rb
- examples/call/call_monitor.rb
- examples/daemonize/daemonize.rb
-has_rdoc: true
homepage: http://daemons.rubyforge.org
licenses: []
-
post_install_message:
rdoc_options: []
-
-require_paths:
+require_paths:
- lib
-required_ruby_version: !ruby/object:Gem::Requirement
- requirements:
- - - ">="
- - !ruby/object:Gem::Version
- segments:
- - 0
- version: "0"
-required_rubygems_version: !ruby/object:Gem::Requirement
- requirements:
- - - ">="
- - !ruby/object:Gem::Version
- segments:
- - 0
- version: "0"
+required_ruby_version: !ruby/object:Gem::Requirement
+ none: false
+ requirements:
+ - - ! '>='
+ - !ruby/object:Gem::Version
+ version: '0'
+required_rubygems_version: !ruby/object:Gem::Requirement
+ none: false
+ requirements:
+ - - ! '>='
+ - !ruby/object:Gem::Version
+ version: '0'
requirements: []
-
rubyforge_project: daemons
-rubygems_version: 1.3.6
+rubygems_version: 1.8.23
signing_key:
specification_version: 2
summary: A toolkit to create and control daemons in different ways
test_files: []
-
diff --git a/setup.rb b/setup.rb
old mode 100755
new mode 100644
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-daemons.git
More information about the Pkg-ruby-extras-commits
mailing list