]> git.uio.no Git - usit-rt.git/blobdiff - sbin/rt-server
Merge branch 'master' of git.uio.no:usit-rt
[usit-rt.git] / sbin / rt-server
index ef6e0f72ae22f939f40c0834a4814b09e6ef4d9b..ac61def46a69662f86523d7475bd2c6bb35e0a17 100755 (executable)
@@ -3,7 +3,7 @@
 #
 # COPYRIGHT:
 #
-# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC
+# This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC
 #                                          <sales@bestpractical.com>
 #
 # (Except where explicitly superseded by other copyright notices)
@@ -84,6 +84,9 @@ if (grep { m/help/ } @ARGV) {
 }
 
 require RT;
+die "Wrong version of RT $RT::VERSION found; need 4.2.*"
+    unless $RT::VERSION =~ /^4\.2\./;
+
 RT->LoadConfig();
 RT->InitPluginPaths();
 RT->InitLogging();
@@ -120,7 +123,7 @@ EOF
 
     RT->InstallMode(1);
 } else {
-    RT->Init();
+    RT->Init( Heavy => 1 );
 
     my ($status, $msg) = RT::Handle->CheckCompatibility( $RT::Handle->dbh, 'post');
     unless ( $status ) {
@@ -131,6 +134,7 @@ EOF
 
 # we must disconnect DB before fork
 if ($RT::Handle) {
+    $RT::Handle->dbh->disconnect if $RT::Handle->dbh;
     $RT::Handle->dbh(undef);
     undef $RT::Handle;
 }