The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

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, the 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 --pidfile 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.

--cfgfile

This defines an optional configuration file.

--pidfile

This defines the pid file for recording the pid.

--daemon

Become a daemon.

SEE ALSO

XAS

AUTHOR

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

COPYRIGHT AND LICENSE

Copyright (C) 2014 Kevin L. Esteb

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.

See http://dev.perl.org/licenses/ for more information.