Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
64cf1503
Commit
64cf1503
authored
Oct 30, 2003
by
Leigh B. Stoller
Browse files
More changes to initkey stuff.
parent
942443cc
Changes
2
Hide whitespace changes
Inline
Side-by-side
sql/database-migrate.txt
View file @
64cf1503
...
...
@@ -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.
...
...
sql/initkey.pl
View file @
64cf1503
...
...
@@ -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
$
secre
tkey
=
TBGenSecretKey
();
while
((
$pid
,
$eid
,
$gid
,
$creator
)
=
$query_result
->
fetchrow_array
())
{
my
$
even
tkey
=
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
");
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment