Commit 64cf1503 authored by Leigh Stoller's avatar Leigh Stoller

More changes to initkey stuff.

parent 942443cc
......@@ -1040,7 +1040,7 @@ last_net_act,last_cpu_act,last_ext_act);
To initialize run the initkey.pl script in this directory:
./initkey.pl | mysql tbdb
sudo ./initkey.pl
1.196: Add new virt_programs table to hold the details of a program
object.
......
......@@ -6,7 +6,7 @@
#
use English;
use lib "/usr/testbed/lib";
use lib "/usr/testbed/devel/stoller/lib";
use libdb;
use libtestbed;
......@@ -17,12 +17,22 @@ $ENV{'PATH'} = '/bin:/usr/bin:/usr/sbin';
delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
$query_result =
DBQueryFatal("select pid,eid from experiments ".
DBQueryFatal("select pid,eid,gid,expt_head_uid from experiments ".
"where eventkey is null");
while (($pid,$eid) = $query_result->fetchrow_array()) {
my $secretkey = TBGenSecretKey();
while (($pid,$eid,$gid,$creator) = $query_result->fetchrow_array()) {
my $eventkey = TBGenSecretKey();
print "update experiments set eventkey='$secretkey' ".
"where pid='$pid' and eid='$eid';\n";
DBQueryFatal("update experiments set eventkey='$eventkey' ".
"where pid='$pid' and eid='$eid'");
my $keyfile = TBDB_EVENTKEY($pid, $eid);
if (!open(KEY, ">$keyfile")) {
warn("Could not create $keyfile: $!\n");
next;
}
print KEY $eventkey;
close(KEY);
system("chown $creator $keyfile");
}
Markdown is supported
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