Task-Server: nicht starten, solange Auth-DB-Upgrades eingespielt werden müssen
authorMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 16 Dec 2015 13:36:26 +0000 (14:36 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 16 Dec 2015 13:36:43 +0000 (14:36 +0100)
scripts/task_server.pl

index 1bcb719..1de0a67 100755 (executable)
@@ -32,6 +32,7 @@ use File::Spec;
 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;
@@ -210,6 +211,18 @@ EOT
     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 ();