From a63be3ade409baf428160656cbdbd876486c7278 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 29 Aug 2012 17:56:27 +0200 Subject: [PATCH] Task-Server und -Control-Modul auf neue Konfigurationsdateinamen angepasst --- SL/System/TaskServer.pm | 12 +++++++----- scripts/task_server.pl | 3 ++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/SL/System/TaskServer.pm b/SL/System/TaskServer.pm index bceb8f598..17be8edac 100644 --- a/SL/System/TaskServer.pm +++ b/SL/System/TaskServer.pm @@ -61,12 +61,14 @@ sub wake_up { sub _read_pid { my ($self) = @_; - my $exe_dir = SL::System::Process->exe_dir; - my $pid_file_name = join '.', splitdir($exe_dir), 'config.lx_office.conf.pid'; - my $pid_file_path = catfile(catdir($exe_dir, 'users', 'pid'), $pid_file_name); + my $exe_dir = SL::System::Process->exe_dir; - return undef unless -f $pid_file_path; - return join('', read_file($pid_file_path)) * 1; + foreach my $conf (qw(kivitendo.conf lx_office.conf kivitendo.conf.default)) { + my $pid_file_name = join '.', splitdir($exe_dir), "config.${conf}.pid"; + my $pid_file_path = catfile(catdir($exe_dir, 'users', 'pid'), $pid_file_name); + + return join('', read_file($pid_file_path)) * 1 if -f $pid_file_path; + } } sub _run_script_command { diff --git a/scripts/task_server.pl b/scripts/task_server.pl index 8c17ca70a..d84e8115b 100755 --- a/scripts/task_server.pl +++ b/scripts/task_server.pl @@ -21,6 +21,7 @@ use Daemon::Generic; use Data::Dumper; use DateTime; use English qw(-no_match_vars); +use List::Util qw(first); use POSIX qw(setuid setgid); use SL::Auth; use SL::DB::BackgroundJob; @@ -143,7 +144,7 @@ my $pidbase = "${cwd}/users/pid"; mkdir($pidbase) if !-d $pidbase; -my $file = -f "${cwd}/config/lx_office.conf" ? "${cwd}/config/lx_office.conf" : "${cwd}/config/lx_office.conf.default"; +my $file = first { -f } ("${cwd}/config/kivitendo.conf", "${cwd}/config/lx_office.conf", "${cwd}/config/kivitendo.conf.default"); newdaemon(configfile => $file, progname => 'kivitendo-task-server', pidbase => "${pidbase}/", -- 2.20.1