summaryrefslogtreecommitdiff
path: root/PerlDaemon.pl
diff options
context:
space:
mode:
Diffstat (limited to 'PerlDaemon.pl')
-rw-r--r--PerlDaemon.pl10
1 files changed, 8 insertions, 2 deletions
diff --git a/PerlDaemon.pl b/PerlDaemon.pl
index a6129f2..c788f3e 100644
--- a/PerlDaemon.pl
+++ b/PerlDaemon.pl
@@ -83,7 +83,7 @@ sub readconf ($) {
# Check
my $msg = 'Missing property:';
- foreach (qw(wd pidfile logfile)) {
+ foreach (qw(wd loopinterval alivefile pidfile logfile)) {
my $key = "daemon.$_";
die "$msg $key\n" unless exists $conf{$key};
}
@@ -136,14 +136,20 @@ sub prestartup ($) {
checkpid $conf;
}
+sub alive ($) {
+ my $conf = shift;
+}
+
sub daemonloop ($) {
my $conf = shift;
my $dlogic = DaemonLogic->new($conf);
+ my $loopinterval = $conf->{'daemon.loopinterval'};
my $loop = shift;
for (my $i = 1;;++$i) {
$dlogic->do();
- sleep 3;
+ sleep $loopinterval;
+ alive $conf;
}
}