File: ctrl_hanging.rb

package info (click to toggle)
ruby-daemons 1.4.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 388 kB
  • sloc: ruby: 2,133; makefile: 7
file content (19 lines) | stat: -rw-r--r-- 487 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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'

options = {
  #:mode => :exec,
  :multiple => true,
  :no_pidfiles => true,
  :force_kill_waittime => 5
  #:force_kill_waittime => -1    # do not wait before killing -9
}

Daemons.run(File.join(File.dirname(__FILE__), 'myserver_hanging.rb'), options)