Francois Gouget : testbot/CheckWineTestBot: Don' t try to restart the Engine if not root.
Alexandre Julliard
julliard at winehq.org
Mon Jun 10 14:42:46 CDT 2013
Module: tools
Branch: master
Commit: 30d9683c1f3103d629435569ad41df58fcf2e057
URL: http://source.winehq.org/git/tools.git/?a=commit;h=30d9683c1f3103d629435569ad41df58fcf2e057
Author: Francois Gouget <fgouget at codeweavers.com>
Date: Sat Jun 8 00:47:22 2013 +0200
testbot/CheckWineTestBot: Don't try to restart the Engine if not root.
---
testbot/scripts/CheckWineTestBot.pl | 14 +++++++++++---
1 files 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";
}
More information about the wine-cvs
mailing list