NAME

XAS::Lib::App::Daemon - The base class to write daemons within the XAS environment

SYNOPSIS

use XAS::Lib::App::Daemon;

my $app = XAS::Lib::App::Daemon->new();

$app->run();

DESCRIPTION

This module defines an operating environment for daemons. A daemon is a Unix background process without a controlling terminal. Windows really doesn't have a concept for this behavior. For running background jobs on Windows please see XAS::Lib::App::Services.

This module is also single threaded, it doesn't use POE to provide an async environment. If you need that, then see the above module. This inherits from XAS::Lib::App. Please see that module for additional documentation.

METHODS

define_pidfile

This method sets up the pid file for the process. By default, this file is named $XAS_RUN/<$0>.pid. This can be overridden by the --pid-file option.

define_signals

This method sets up basic signal handling. By default this is only for the INT, TERM, HUP and QUIT signals.

define_daemon

This method will cause the process to become a daemon.

OPTIONS

This module handles these additional options.

--cfg-file

This defines an optional configuration file.

--pid-file

This defines the pid file for recording the pid.

--daemon

Become a daemon.

SEE ALSO

XAS::Lib::App
XAS

AUTHOR

Kevin L. Esteb, <kevin@kesteb.us>

COPYRIGHT AND LICENSE

Copyright (c) 2012-2015 Kevin L. Esteb

This is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0. For details, see the full text of the license at http://www.perlfoundation.org/artistic_license_2_0.