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;
use SL::BackgroundJob::ALL;
use SL::Form;
use SL::Helper::DateTime;
+use SL::InstanceConfiguration;
use SL::LXDebug;
use SL::LxOfficeConf;
use SL::Locale;
package main;
- $::lxdebug = LXDebug->new;
- $::locale = Locale->new($::lx_office_conf{system}->{language});
- $::form = Form->new;
- $::auth = SL::Auth->new;
- $::request = { cgi => CGI->new({}) };
+ $::lxdebug = LXDebug->new;
+ $::locale = Locale->new($::lx_office_conf{system}->{language});
+ $::form = Form->new;
+ $::auth = SL::Auth->new;
+ $::instance_conf = SL::InstanceConfiguration->new;
+ $::request = { cgi => CGI->new({}) };
die 'cannot reach auth db' unless $::auth->session_tables_present;
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}/",