use List::Util qw(first);
use POSIX qw(setuid setgid);
use SL::Auth;
+use SL::DBUpgrade2;
use SL::DB::AuthClient;
use SL::DB::BackgroundJob;
use SL::BackgroundJob::ALL;
Form::disconnect_standard_dbh;
SL::DBConnect::Cache->disconnect_all_and_clear;
SL::DB->db_cache->clear;
+
+ File::Temp::cleanup();
}
sub drop_privileges {
exit 2;
}
+ initialize_kivitendo();
+
+ my $dbupdater_auth = SL::DBUpgrade2->new(form => $::form, auth => 1)->parse_dbupdate_controls;
+ if ($dbupdater_auth->unapplied_upgrade_scripts($::auth->dbconnect)) {
+ print STDERR <<EOT;
+The authentication database requires an upgrade. Please login to
+kivitendo's administration interface in order to apply it. The task
+server cannot start until the upgrade has been applied.
+EOT
+ exit 2;
+ }
+
drop_privileges();
return ();
sub gd_run {
while (1) {
+ $SIG{'ALRM'} = 'IGNORE';
+
run_once_for_all_clients();
debug("Sleeping");
my $seconds = 60 - (localtime)[0];
if (!eval {
- local $SIG{'ALRM'} = sub {
+ $SIG{'ALRM'} = sub {
+ $SIG{'ALRM'} = 'IGNORE';
debug("Got woken up by SIGALRM");
die "Alarm!\n"
};