diff options
| author | Paul Buetow <paul@buetow.org> | 2021-05-31 10:09:19 +0100 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2021-05-31 10:09:19 +0100 |
| commit | d3a70f706d57530e6c3a12364af0fdcf51ec6e20 (patch) | |
| tree | 2eb8d872ee3ae5254850c4cc9e2f3372659f594e /gemfeed/2011-05-07-perl-daemon-service-framework.html | |
| parent | c7d03dc1b79d2214db40e322a31d1844b1c64d87 (diff) | |
Publishing new version
Diffstat (limited to 'gemfeed/2011-05-07-perl-daemon-service-framework.html')
| -rw-r--r-- | gemfeed/2011-05-07-perl-daemon-service-framework.html | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/gemfeed/2011-05-07-perl-daemon-service-framework.html b/gemfeed/2011-05-07-perl-daemon-service-framework.html index 5a8e0c2d..ea22da58 100644 --- a/gemfeed/2011-05-07-perl-daemon-service-framework.html +++ b/gemfeed/2011-05-07-perl-daemon-service-framework.html @@ -56,18 +56,18 @@ h2, h3 { //\ //\\ //\ //\\ //\ //\\jrei </pre> <p class="quote"><i>Written by Paul Buetow 2011-05-07, last updated 2021-05-07</i></p> -<p>PerlDaemon is a minimal daemon for Linux and other Unix like operating systems programmed in Perl. It is a minimal but pretty functional and fairly generic service framework. This means that it does not do anything useful other than providing a framework for starting, stopping, configuring and logging. In order to do something useful, a module (written in Perl) must be provided.</p> +<p>PerlDaemon is a minimal daemon for Linux and other Unix like operating systems programmed in Perl. It is a minimal but pretty functional and fairly generic service framework. This means that it does not do anything useful other than providing a framework for starting, stopping, configuring and logging. To do something useful, a module (written in Perl) must be provided.</p> <h2>Features</h2> <p>PerlDaemon supports:</p> <ul> <li>Automatic daemonizing</li> <li>Logging</li> -<li>logrotation (via SIGHUP)</li> +<li>log rotation (via SIGHUP)</li> <li>Clean shutdown support (SIGTERM)</li> <li>Pid file support (incl. check on startup)</li> <li>Easy to configure</li> <li>Easy to extend</li> -<li>Multi instance support (just use a different directory for each instance).</li> +<li>Multi-instance support (just use a different directory for each instance).</li> </ul> <h2>Quick Guide</h2> <pre> @@ -80,9 +80,9 @@ h2, h3 { # Alternatively: Starting in foreground ./bin/perldaemon start daemon.daemonize=no (or shortcut ./control foreground) </pre> -<p>To stop a daemon running in foreground mode "Ctrl+C" must be hit. To see more available startup options run "./control" without any argument.</p> +<p>To stop a daemon from running in foreground mode, "Ctrl+C" must be hit. To see more available startup options run "./control" without any argument.</p> <h2>How to configure</h2> -<p>The daemon instance can be configured in "./conf/perldaemon.conf". If you want to change a property only once, it is also possible to specify it on command line (that then will take precedence over the config file). All available config properties can be viewed via "./control keys":</p> +<p>The daemon instance can be configured in "./conf/perldaemon.conf". If you want to change a property only once, it is also possible to specify it on the command line (which will take precedence over the config file). All available config properties can be displayed via "./control keys":</p> <pre> pb@titania:~/svn/utils/perldaemon/trunk$ ./control keys # Path to the logfile @@ -100,10 +100,10 @@ daemon.daemonize=yes # Path to the pidfile daemon.pidfile=./run/perldaemon.pid -# Each module should run every runinterval seconds +# Each module should run every run interval seconds daemon.modules.runinterval=3 -# Path to the alive file (is touched every loopinterval seconds, usable to monitor) +# Path to the alive file (is touched every loop interval seconds, usable for monitoring) daemon.alivefile=./run/perldaemon.alive # Specifies the working directory @@ -124,15 +124,15 @@ Mon Jun 13 11:29:27 2011 (PID 2838): ExampleModule Test 2 $ ./control stop Stopping daemon now... </pre> -<p>If you want to change that property forever either edit perldaemon.conf or do this:</p> +<p>If you want to change that property forever, either edit perldaemon.conf or do this:</p> <pre> $ ./control keys daemon.loopinterval=10 > new.conf; mv new.conf conf/perldaemon.conf </pre> <h2>HiRes event loop</h2> -<p>PerlDaemon uses `Time::HiRes` to make sure that all the events run in correct intervals. Each loop run a time carry value is recorded and added to the next loop run in order to catch up lost time.</p> +<p>PerlDaemon uses `Time::HiRes` to make sure that all the events run incorrect intervals. For each loop run, a time carry value is recorded and added to the next loop run to catch up on lost time.</p> <h2>Writing your own modules</h2> <h3>Example module</h3> -<p>This is one of the example modules you will find in the source code. It should be quite self-explanatory if you know Perl :-).</p> +<p>This is one of the example modules you will find in the source code. It should be pretty self-explanatory if you know Perl :-).</p> <pre> package PerlDaemonModules::ExampleModule; @@ -174,7 +174,7 @@ sub do ($) { ./bin/perldaemon restart (or shortcurt ./control restart) </pre> <p>Now watch `./log/perldaemon.log` closely. It is a good practice to test your modules in 'foreground mode' (see above how to do that).</p> -<p>BTW: You can install as many modules within the same instance as desired. But they are run in sequential order (in future they can also run in parallel using several threads or processes).</p> +<p>BTW: You can install as many modules within the same instance as desired. But they are run in sequential order (in future, they can also run in parallel using several threads or processes).</p> <h2>May the source be with you</h2> <p>You can find PerlDaemon (including the examples) at:</p> <a class="textlink" href="https://github.com/snonux/perldaemon">https://github.com/snonux/perldaemon</a><br /> |
