The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Daemonise::Plugin::Daemon - Daemonise plugin handling PID file and forking

VERSION

version 2.13

SYNOPSIS

    use Daemonise;

    my $d = Daemonise->new();
    $d->debug(1);
    $d->foreground(1) if $d->debug;
    $d->config_file('/path/to/some.conf');

    $d->configure;

    # fork and run in background (unless foreground is true)
    $d->start(\&main);

    sub main {
        # check if daemon is running already
        $d->status;
    }

ATTRIBUTES

user

uid

group

gid

pid_file

running

phase

logfile

foreground

loops

pid_dir

bin_dir

interval

SUBROUTINES/METHODS provided

configure

log

stop

start

dont_loop / loop

deactivate code looping for deamon this could be done with MouseX::NativeTraits, but i didn't want to use another module for just changing boolean values

check_pid_file

daemonise

stdout_redirect

status

AUTHOR

Lenz Gschwendtner <norbu09@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by Lenz Gschwendtner.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.