Class Daemons::Application
In: lib/daemons/application.rb
Parent: Object

Methods

Constants

SIGNAL = (RUBY_PLATFORM =~ /win32/ ? 'KILL' : 'TERM')

Attributes

app_argv  [RW] 
controller_argv  [RW] 
group  [R]  the ApplicationGroup the application belongs to
options  [R]  my private options
pid  [R]  the Pid instance belonging to this application

Public Class methods

Public Instance methods

This is a nice little function for debugging purposes: In case a multi-threaded ruby script exits due to an uncaught exception it may be difficult to find out where the exception came from because one cannot catch exceptions that are thrown in threads other than the main thread.

This function searches for all exceptions in memory and outputs them to STDERR (if it is connected) and to a log file in the pid-file directory.

This function implements a (probably too simle) method to detect whether the program with the pid found in the pid-file is still running. It just searches for the pid in the output of ps ax, which is probably not a good idea in some cases. Alternatives would be to use a direct access method the unix process control system.

this function is only used to daemonize the currently running process (Daemons.daemonize)

[Validate]