X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/c3f94f18040a7905d4bf615684b6d51d85a959b1..0f988add03549dbb11f12e0e3c6ab8fcbcdea911:/scripts/task_server.pl diff --git a/scripts/task_server.pl b/scripts/task_server.pl index 2c4a05fd4..8c17ca70a 100755 --- a/scripts/task_server.pl +++ b/scripts/task_server.pl @@ -125,7 +125,16 @@ sub gd_run { } my $seconds = 60 - (localtime)[0]; - sleep($seconds < 30 ? $seconds + 60 : $seconds); + if (!eval { + local $SIG{'ALRM'} = sub { + $::lxdebug->message(0, "Got woken up by SIGALRM") if $lx_office_conf{task_server}->{debug}; + die "Alarm!\n" + }; + sleep($seconds < 30 ? $seconds + 60 : $seconds); + 1; + }) { + die $@ unless $@ eq "Alarm!\n"; + } } } @@ -136,7 +145,7 @@ mkdir($pidbase) if !-d $pidbase; my $file = -f "${cwd}/config/lx_office.conf" ? "${cwd}/config/lx_office.conf" : "${cwd}/config/lx_office.conf.default"; newdaemon(configfile => $file, - progname => 'lx-office-task-server', + progname => 'kivitendo-task-server', pidbase => "${pidbase}/", );