Class: Daemons::Application

Inherits:
Object
  • Object
show all
Defined in:
lib/cinchize.rb

Instance Method Summary collapse

Instance Method Details

#start_noneObject



222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
# File 'lib/cinchize.rb', line 222

def start_none
  unless options[:ontop]
    Daemonize.daemonize(output_logfile, @group.app_name) # our change goes here
  else
    Daemonize.simulate
  end

  @pid.pid = Process.pid

  at_exit {
    begin; @pid.cleanup; rescue ::Exception; end
    if options[:backtrace] and not options[:ontop] and not $daemons_sigterm
      begin; exception_log(); rescue ::Exception; end
    end
  }
  trap(SIGNAL) {
    begin; @pid.cleanup; rescue ::Exception; end
    $daemons_sigterm = true

    if options[:hard_exit]
      exit!
    else
      exit
    end
  }
end