[Tools] testbot/CheckWineTestBot: Don't try to restart the Engine if not root.

Francois Gouget fgouget at codeweavers.com
Fri Jun 7 17:47:22 CDT 2013


---
 testbot/scripts/CheckWineTestBot.pl |   14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/testbot/scripts/CheckWineTestBot.pl b/testbot/scripts/CheckWineTestBot.pl
index 5e8a053..a0c0bda 100755
--- a/testbot/scripts/CheckWineTestBot.pl
+++ b/testbot/scripts/CheckWineTestBot.pl
@@ -44,8 +44,11 @@ delete $ENV{ENV};
 my $rc = 0;
 if (! PingEngine())
 {
-  system "service winetestbot restart > /dev/null";
-  sleep 5;
+  if ($> == 0)
+  {
+    system "service winetestbot restart > /dev/null";
+    sleep 5;
+  }
   
   open (SENDMAIL, "|/usr/sbin/sendmail -oi -t -odq");
   print SENDMAIL <<"EOF";
@@ -54,7 +57,12 @@ To: $AdminEMail
 Subject: WineTestBot engine died
 
 EOF
-  if (PingEngine())
+  if ($> != 0)
+  {
+    print SENDMAIL "Insufficient permissions to restart the engine\n";
+    $rc = 1;
+  }
+  elsif (PingEngine())
   {
     print SENDMAIL "The engine was restarted successfully\n";
   }
-- 
1.7.10.4



More information about the wine-patches mailing list