Commit fef720df authored by Mac Newbold's avatar Mac Newbold
Browse files

Fix how we run and kill stated when we're in full mode.

parent e1fca984
...@@ -73,6 +73,7 @@ if ($0 =~ m|/|) { ...@@ -73,6 +73,7 @@ if ($0 =~ m|/|) {
} }
$path = $pwd; $path = $pwd;
$TB = "$path/install";
$ENV{'PATH'} = "/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/site/bin:$basedir:."; $ENV{'PATH'} = "/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/site/bin:$basedir:.";
$basepath = $ENV{'PATH'}; $basepath = $ENV{'PATH'};
...@@ -391,9 +392,9 @@ sub step_init { ...@@ -391,9 +392,9 @@ sub step_init {
} }
open(CONF,">$path/config"); open(CONF,">$path/config");
print CONF "$basedir/../configure \\\n". print CONF "$basedir/../configure \\\n".
"--prefix=$path/install \\\n$testmode \\\n--with-TBDEFS=$path/defs\n"; "--prefix=$TB \\\n$testmode \\\n--with-TBDEFS=$path/defs\n";
close(CONF); close(CONF);
tbexec("$basedir/../configure --prefix=$path/install $testmode ". tbexec("$basedir/../configure --prefix=$TB $testmode ".
"--with-TBDEFS=$path/defs", "--with-TBDEFS=$path/defs",
"$path/configure.log"); "$path/configure.log");
...@@ -429,7 +430,7 @@ sub step_init { ...@@ -429,7 +430,7 @@ sub step_init {
prints "ERROR: Could not connect to new DB.\n"; prints "ERROR: Could not connect to new DB.\n";
doexit(1); doexit(1);
}; };
$ENV{'PATH'} = "$basepath:$path/install/bin:$path/install/sbin"; $ENV{'PATH'} = "$basepath:$TB/bin:$TB/sbin";
# #
# Clear our extraneous stuff. # Clear our extraneous stuff.
...@@ -565,7 +566,7 @@ sub step_test { ...@@ -565,7 +566,7 @@ sub step_test {
prints "Testlist: $testlist\n"; prints "Testlist: $testlist\n";
# Let's add some stuff to our path # Let's add some stuff to our path
$ENV{'PATH'} = "$basepath:$path/install/bin:$path/install/sbin"; $ENV{'PATH'} = "$basepath:$TB/bin:$TB/sbin";
my @tests; my @tests;
my $testmode; my $testmode;
...@@ -630,9 +631,8 @@ sub step_test { ...@@ -630,9 +631,8 @@ sub step_test {
# Start stated # Start stated
if ($type eq "full") { if ($type eq "full") {
# Returns non-zero for failures # Returns non-zero for failures
system("$path/install/sbin/withadminprivs ". system("$TB/sbin/stated") and
"$path/install/sbin/stated") and die "Error running '$TB/sbin/stated': $!\n";
die "Error running $path/install/sbin/stated: $!\n";
} }
# We're now ready to run the test. # We're now ready to run the test.
...@@ -676,7 +676,9 @@ sub step_test { ...@@ -676,7 +676,9 @@ sub step_test {
} }
if ($type eq "full") { if ($type eq "full") {
my $statedpidfile = "$path/install/locks/stated.pid"; my $ext = $TB;
$ext =~ s/\//\./g;
my $statedpidfile = "/var/run/stated$ext.pid";
my $statedpid = `cat $statedpidfile` || my $statedpid = `cat $statedpidfile` ||
prints "WARNING: Unable to find stated pid: $!\n"; prints "WARNING: Unable to find stated pid: $!\n";
if (! kill(15, $statedpid) ) { if (! kill(15, $statedpid) ) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment