Class: Daemons::Application

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

### Methods

exception_log logfile new pidfile_dir running? script show_status start start_exec start_load start_none start_proc stop zap zap!

### 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

new(group, add_options = {}, pid = nil)

### Public Instance methods

exception_log()

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.

logfile()
pidfile_dir()
running?()

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.

script()
show_status()
start()
start_exec()
start_load()
start_none()

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

start_proc()
stop()
zap()
zap!()

[Validate]