X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/4531a6c712b2529a01f31ddde2ef4d7045d173c7..5c41c19b68c3edeb374b32fd75ac4253aafc4df1:/scripts/task_server.pl diff --git a/scripts/task_server.pl b/scripts/task_server.pl index 5854a5197..f438b7410 100755 --- a/scripts/task_server.pl +++ b/scripts/task_server.pl @@ -123,7 +123,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"; + } } } @@ -134,7 +143,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}/", );