Class: Daemons::Application

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

Instance Method Summary collapse

Instance Method Details

#start_noneObject



173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# File 'lib/cinchize.rb', line 173

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