Skip to content
GitLab
Menu
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
84cc8e8b
Commit
84cc8e8b
authored
Aug 24, 2010
by
Leigh B Stoller
Browse files
Integrate ProtoGENI DB updates into the automated update process.
parent
0e5290ab
Changes
3
Hide whitespace changes
Inline
Side-by-side
install/update-testbed.in
View file @
84cc8e8b
...
...
@@ -37,8 +37,11 @@ my $TBOPS = "@TBOPSEMAIL@";
my
$DBNAME
=
"
@TBDBNAME
@
";
my
$SRCDIR
=
"
@top_srcdir
@
";
my
$SQLUPDATEDIR
=
"
$SRCDIR
/sql/updates
";
my
$PGENIUPDATEDIR
=
"
$SRCDIR
/protogeni/updates
";
my
$UPDATEDIR
=
"
$SRCDIR
/install/updates
";
my
$DBUPDATE
=
"
$TB
/sbin/dbupdate
";
my
$PGENIUPDATE
=
"
$TB
/sbin/protogeni/update
";
my
$PGENISUPPORT
=
@PROTOGENI_SUPPORT@
;
my
$INSTALLUPDATE
=
"
$TB
/sbin/update-install
";
my
$SETSITEVAR
=
"
$TB
/sbin/setsitevar
";
my
$STARTUP
=
"
/usr/local/etc/rc.d/3.testbed.sh
";
...
...
@@ -172,6 +175,14 @@ if ($verify) {
$exitval
++
if
(
$?
);
if
(
$PGENISUPPORT
)
{
print
"
Checking for ProtoGENI DB updates ...
\n
";
system
("
perl
@INCDIRS
../protogeni/scripts/update
"
.
"
-q -v -p
$PGENIUPDATEDIR
");
$exitval
++
if
(
$?
);
}
exit
(
0
)
if
(
!
$exitval
);
...
...
@@ -297,6 +308,14 @@ system("perl @INCDIRS ./update-install $forceopt -q -a pre -p $UPDATEDIR");
exit
(
1
)
if
(
$?
);
if
(
$PGENISUPPORT
)
{
print
"
Running ProtoGENI DB updates ...
\n
";
system
("
perl
@INCDIRS
../protogeni/scripts/update
"
.
"
-q -p
$PGENIUPDATEDIR
");
exit
(
1
)
if
(
$?
);
}
if
(
$install
)
{
print
"
Installing testbed software ... this will take a while!
\n
";
print
"
Output saved to
$tempfile
\n
";
...
...
protogeni/lib/genischemacheck.pl.in
View file @
84cc8e8b
...
...
@@ -2,7 +2,7 @@
#
# GENIPUBLIC-COPYRIGHT
# Copyright (c) 2000-200
9
University of Utah and the Flux Group.
# Copyright (c) 2000-20
1
0 University of Utah and the Flux Group.
# All rights reserved.
#
use
strict
;
...
...
@@ -49,24 +49,9 @@ for my $db ( "geni", "geni-ch", "geni-cm" ) {
}
if
(
$outofdate
)
{
chdir
(
"
..
"
);
my
$objdir
=
`
/bin/pwd
`;
chomp
(
$objdir
);
print
<<
"
EOSTR
";
The
schemata
described
in
$testbed_srcdir
/protogeni/upda
tes
differ
from
the
running
databases
.
As
a
safety
measure
,
you
will
not
be
able
to
install
until
this
is
resolved
.
If
you
are
a
user
of
the
emulab
software
outside
of
Utah
,
this
is
probably
because
your
database
was
created
for
an
older
version
of
the
emulab
software
.
You
can
update
your
database
by:
boss
>
cd
/your/s
rcdir
/protogeni/upda
tes
boss
>
sudo
perl
$objdir
/scripts/upda
te
EOSTR
print
"
*** Your ProtoGENI DB schema is out of date with the master.
\n
";
print
"
As a safety measure, you will not be able to install until
\n
";
print
"
this is resolved.
\n
";
exit
(
1
);
}
else
{
exit
(
0
);
...
...
protogeni/scripts/update.in
View file @
84cc8e8b
#!/usr/bin/perl -w
#
# GENIPUBLIC-COPYRIGHT
# Copyright (c) 2008-200
9
University of Utah and the Flux Group.
# Copyright (c) 2008-20
1
0 University of Utah and the Flux Group.
# All rights reserved.
#
use
strict
;
...
...
@@ -13,10 +13,15 @@ use Getopt::Std;
#
sub
usage
()
{
print
"
Usage: update
\n
";
print
"
Usage: update
[-q] [-v] [-d] [-p path]
\n
";
exit
(
1
);
}
my
$optlist
=
"";
my
$optlist
=
"
dvp:q
";
my
$debug
=
0
;
my
$verify
=
0
;
my
$quiet
=
0
;
my
$path
;
my
$args
=
"";
#
# Configure variables
...
...
@@ -56,10 +61,6 @@ use Experiment;
use
GeniDB
;
use
GeniCertificate
;
if
(
$UID
!=
0
)
{
fatal
("
Must be root to run this script
\n
");
}
#
# Check args.
#
...
...
@@ -67,21 +68,46 @@ my %options = ();
if
(
!
getopts
(
$optlist
,
\
%options
))
{
usage
();
}
if
(
defined
(
$options
{"
d
"}))
{
$debug
=
1
;
$args
.=
"
-d
";
}
if
(
defined
(
$options
{"
q
"}))
{
$quiet
=
1
;
$args
.=
"
-q
";
}
if
(
defined
(
$options
{"
v
"}))
{
$verify
=
1
;
$args
.=
"
-v
";
}
if
(
defined
(
$options
{"
p
"}))
{
$path
=
$options
{"
p
"};
$args
.=
"
-p
$path
";
}
usage
()
if
(
@ARGV
);
OneShot
();
OneShot
()
if
(
!
$verify
);
if
(
!
$verify
&&
$UID
!=
0
)
{
fatal
("
Must be root to run this script
\n
");
}
#
# Apply the dbupdates using the Emulab utility, to all three DBs.
#
system
("
$DBUPDATE
"
.
GENISA_DBNAME
())
==
0
or
fatal
("
Could not apply updates to SA DB
");
system
("
$DBUPDATE
"
.
GENICM_DBNAME
())
==
0
or
fatal
("
Could not apply updates to CM DB
");
system
("
$DBUPDATE
"
.
GENICH_DBNAME
())
==
0
or
fatal
("
Could not apply updates to CH DB
");
#
# Apply the dbupdates using the Emulab utility, to all three DBs.
#
foreach
my
$name
(
GENISA_DBNAME
(),
GENICM_DBNAME
(),
GENICH_DBNAME
())
{
system
("
$DBUPDATE
$args
$name
");
if
(
$?
)
{
exit
(
1
)
if
(
$verify
);
fatal
("
Could not apply updates to
$name
DB
");
}
}
exit
(
0
);
#
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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