Sha256: d7e879c5b66b04db4533632e0eda2168803a20d93eb70d673b21d02642afdf69

Contents?: true

Size: 743 Bytes

Versions: 26

Compression:

Stored size: 743 Bytes

Contents

#!/usr/bin/ruby

require "dyndoc/srv/interactive-server"

if ["--no-forever","--no-daemon"].include? ARGV[0]
  Dyndoc::InteractiveServer.new.run
else
  require 'daemons'
  require 'dyndoc/init/home'
  require 'fileutils'

  dir_pids=File.join(Dyndoc.home,"pids")
  dir_log=File.join(Dyndoc.home,"log")
  FileUtils.mkdir_p dir_pids
  FileUtils.mkdir_p dir_log

  ## from delayed_job gem
  @files_to_reopen = []
  ObjectSpace.each_object(File) do |file|
    @files_to_reopen << file unless file.closed?
  end

  Daemons.run_proc('dyn-srv',{dir: dir_pids, log_output: true, log_dir: dir_log}) do
    @files_to_reopen.each do |file|
      file.reopen file.path, 'a+'
      file.sync = true
    end
    Dyndoc::InteractiveServer.new.run
  end

end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
dyndoc-ruby-1.5.0 bin/dyn-srv
dyndoc-ruby-1.4.7 bin/dyn-srv
dyndoc-ruby-1.4.6 bin/dyn-srv
dyndoc-ruby-1.4.5 bin/dyn-srv
dyndoc-ruby-1.4.2 bin/dyn-srv
dyndoc-ruby-1.4.1 bin/dyn-srv
dyndoc-ruby-1.4.0 bin/dyn-srv
dyndoc-ruby-1.3.9 bin/dyn-srv
dyndoc-ruby-1.3.6 bin/dyn-srv
dyndoc-ruby-1.3.4 bin/dyn-srv
dyndoc-ruby-1.3.2 bin/dyn-srv
dyndoc-ruby-1.3.0 bin/dyn-srv
dyndoc-ruby-1.2.2 bin/dyn-srv
dyndoc-ruby-1.2.1 bin/dyn-srv
dyndoc-ruby-1.2.0 bin/dyn-srv
dyndoc-ruby-1.0.25 bin/dyn-srv
dyndoc-ruby-1.0.24 bin/dyn-srv
dyndoc-ruby-1.0.23 bin/dyn-srv
dyndoc-ruby-1.0.22 bin/dyn-srv
dyndoc-ruby-1.0.21 bin/dyn-srv