Kernel::System::Daemon::BaseDaemon

NAME

Kernel::System::Daemon::BaseDaemon – daemon base class

DESCRIPTION

Base class for daemon modules.

PUBLIC INTERFACE

PreRun()

Perform additional validations/preparations and wait times before Run().

Override this method in your daemons.

If this method returns true, execution will be continued. If it returns false, the main daemon aborts at this point, and Run() will not be called and the complete daemon module dies waiting to be recreated again in the next loop.

Run()

Runs the daemon.

Override this method in your daemons.

If this method returns true, execution will be continued. If it returns false, the main daemon aborts at this point, and PostRun() will not be called and the complete daemon module dies waiting to be recreated again in the next loop.

PostRun()

Perform additional clean-ups and wait times after Run().

Override this method in your daemons.

If this method returns true, execution will be continued. If it returns false, the main daemon aborts at this point, and PreRun() will not be called again and the complete daemon module dies waiting to be recreated again in the next loop.

Summary()

Provides a summary of what is the daemon doing in the current time, the summary is in form of tabular data and it must contain a header, the definition of the columns, the data, and a message if there was no data.

    my @Summary = $DaemonObject->Summary();

returns

    @Summary = (
        {
            Header => 'Header Message',
            Column => [
                {
                    Name        => 'somename',
                    DisplayName => 'some name',
                    Size        => 40,
                },
                # ...
            ],
            Data => [
                {
                    somename => $ScalarValue,
                    # ...
                },
                # ...
            ],
            NoDataMessage => "Show this message if there is no data.",
        },
    );

Override this method in your daemons.

Scroll to Top