Commit 4136137f authored by Leigh Stoller's avatar Leigh Stoller

Lots more tweaks to create a XEN ElabInElab using the target ip/domain

in which it will later run. Now setting up and protogeni during the
install.
parent 52d55876
......@@ -1428,6 +1428,16 @@ sub SetupOpsNode($)
}
close(RC);
#
# Localize the timezone for the Geni Racks
#
if ($emulabconfig{"CONFIG_GENIRACK"} &&
exists($emulabconfig{"GENIRACK_TIMEZONE"})) {
my $zonefile = $emulabconfig{"GENIRACK_TIMEZONE"};
mysystem("cp -fp /usr/share/zoneinfo/$zonefile /etc/localtime");
}
#
# Remove some cruft from /etc/syslog.conf
#
......@@ -1491,7 +1501,20 @@ sub SetupOpsNode($)
closedir(DIR);
foreach my $list (@lists) {
mysystem("echo ${creator}\@${outer_domain} > /etc/mail/lists/$list");
if ($emulabconfig{"CONFIG_GENIRACK"}) {
my $where = "genirack-ops\@flux.utah.edu";
if ($list eq "testbed-logs") {
$where = "genirack-logs\@flux.utah.edu";
}
elsif ($list eq "testbed-stated") {
$where = "genirack-stated\@flux.utah.edu";
}
mysystem("echo '$where' > /etc/mail/lists/$list");
}
else {
mysystem("echo ${creator}\@${outer_domain} > /etc/mail/lists/$list");
}
}
#
......@@ -2051,6 +2074,16 @@ sub SetupBossNode($)
}
close(RC);
#
# Localize the timezone for the Geni Racks
#
if ($emulabconfig{"CONFIG_GENIRACK"} &&
exists($emulabconfig{"GENIRACK_TIMEZONE"})) {
my $zonefile = $emulabconfig{"GENIRACK_TIMEZONE"};
mysystem("cp -fp /usr/share/zoneinfo/$zonefile /etc/localtime");
}
#
# Remove some cruft from /etc/syslog.conf
#
......@@ -2606,6 +2639,7 @@ sub CreateDefsFile($)
my $opsnode_hostname = $emulabconfig{"OPSNODE"};
my $fsnode_hostname = $emulabconfig{"FSNODE"};
my $ourdomain = $domain;
my $thishomebase = "MyEmulab.Net";
#
# The control network netmask differs if using a single control network.
......@@ -2627,6 +2661,8 @@ sub CreateDefsFile($)
$opsnode_hostname = "ops";
$fsnode_hostname = "ops";
$ourdomain = $emulabconfig{"GENIRACK_DOMAIN"};
$thishomebase = $emulabconfig{"GENIRACK_HOMEBASE"}
if (defined($emulabconfig{"GENIRACK_HOMEBASE"}));
}
my $control_network = inet_ntoa(inet_aton($control_ip) &
......@@ -2698,7 +2734,7 @@ sub CreateDefsFile($)
last SWITCH;
};
/^THISHOMEBASE$/ && do {
print OUTDEFS "THISHOMEBASE=MyEmulab.Net\n";
print OUTDEFS "THISHOMEBASE=${thishomebase}\n";
last SWITCH;
};
/^NTPSERVER$/ && do {
......@@ -2864,11 +2900,6 @@ sub CreateDefsFile($)
}
last SWITCH;
};
/^PROTOGENI_SUPPORT$/ && do {
# Does not work to turn this on during initial setup.
print OUTDEFS "PROTOGENI_SUPPORT=0\n";
last SWITCH;
};
/^FSDIR_SCRATCH$/ && do {
if ($emulabconfig{"CONFIG_SCRATCHFS"}) {
print OUTDEFS "FSDIR_SCRATCH=$FSMOUNTDIR/scratch\n";
......@@ -2938,6 +2969,21 @@ sub CreateDefsFile($)
print OUTDEFS $_;
}
}
if ($emulabconfig{"CONFIG_PROTOGENI"} ||
$emulabconfig{"CONFIG_GENIRACK"}) {
my $protogeni_domain = lc($thishomebase);
if (defined($emulabconfig{"GENIRACK_HOMEBASE"})) {
$protogeni_domain = lc($emulabconfig{"GENIRACK_HOMEBASE"});
}
my $protogeni_password = "";
if (defined($emulabconfig{"PROTOGENI_PASSWORD"})) {
$protogeni_gmocpswd = lc($emulabconfig{"PROTOGENI_PASSWORD"});
}
print OUTDEFS "PROTOGENI_SUPPORT=1\n";
print OUTDEFS "PROTOGENI_GENIRACK=1\n";
print OUTDEFS "PROTOGENI_DOMAIN=\"$protogeni_domain\"\n";
print OUTDEFS "PROTOGENI_PASSWORD=\"$protogeni_password\"\n";
}
close(INDEFS);
close(OUTDEFS);
mysystem("cat /tmp/defs-elabinelab");
......
......@@ -825,6 +825,8 @@ PROTOGENI_DOMAIN
PROTOGENI_RPCPORT
PROTOGENI_RPCNAME
PROTOGENI_URL
PROTOGENI_GENIRACK
PROTOGENI_PASSWORD
STANDALONE_CLEARINGHOUSE
GMAP_API_KEY
NODE_USAGE_SUPPORT
......@@ -4971,6 +4973,8 @@ done
......@@ -5065,6 +5069,8 @@ PROTOGENI_WEBSITE="www.emulab.net"
PROTOGENI_DOMAIN="unknown"
PROTOGENI_RPCPORT=12369
PROTOGENI_RPCNAME=""
PROTOGENI_GENIRACK=0
PROTOGENI_PASSWORD=""
STANDALONE_CLEARINGHOUSE=0
NODE_USAGE_SUPPORT=0
EXP_VIS_SUPPORT=0
......@@ -7184,7 +7190,7 @@ fi
#
# Check for protogeni rspec.
#
if test "$PROTOGENI_SUPPORT" = "1"; then
if test "$PROTOGENI_SUPPORT" = "1" && test $ELABINELAB = "0"; then
if test ! -e "$srcdir/protogeni/rspec-geni/.git"; then
{ $as_echo "$as_me:$LINENO: WARNING: protogeni/rspec-geni submodule not intialized yet" >&5
$as_echo "$as_me: WARNING: protogeni/rspec-geni submodule not intialized yet" >&2;};
......
......@@ -223,6 +223,8 @@ AC_SUBST(PROTOGENI_DOMAIN)
AC_SUBST(PROTOGENI_RPCPORT)
AC_SUBST(PROTOGENI_RPCNAME)
AC_SUBST(PROTOGENI_URL)
AC_SUBST(PROTOGENI_GENIRACK)
AC_SUBST(PROTOGENI_PASSWORD)
AC_SUBST(STANDALONE_CLEARINGHOUSE)
AC_SUBST(GMAP_API_KEY)
AC_SUBST(NODE_USAGE_SUPPORT)
......@@ -328,6 +330,8 @@ PROTOGENI_WEBSITE="www.emulab.net"
PROTOGENI_DOMAIN="unknown"
PROTOGENI_RPCPORT=12369
PROTOGENI_RPCNAME=""
PROTOGENI_GENIRACK=0
PROTOGENI_PASSWORD=""
STANDALONE_CLEARINGHOUSE=0
NODE_USAGE_SUPPORT=0
EXP_VIS_SUPPORT=0
......@@ -891,7 +895,7 @@ fi
#
# Check for protogeni rspec.
#
if test "$PROTOGENI_SUPPORT" = "1"; then
if test "$PROTOGENI_SUPPORT" = "1" && test $ELABINELAB = "0"; then
if test ! -e "$srcdir/protogeni/rspec-geni/.git"; then
AC_MSG_WARN([protogeni/rspec-geni submodule not intialized yet]);
echo "Please cd into your source directory and run:"
......
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2008-2011 University of Utah and the Flux Group.
# Copyright (c) 2008-2012 University of Utah and the Flux Group.
# All rights reserved.
#
package emdbi;
......@@ -557,6 +557,13 @@ sub DBQueryN($$)
$maxtries = 100000;
}
# Mostly for ProtoGeni;
if (!defined($dbnum)) {
print STDERR "DB connection not setup:\n";
print STDERR "Query: '$query'\n";
return undef;
}
# Reconnect to mysqld in child of fork.
if ($DB[$dbnum]->pid() != $PID) {
if (TBDBReconnect(1) != 0) {
......
......@@ -5,20 +5,6 @@
<mapping name="FBSD-STD">
<value>FBSD62-STD</value>
</mapping>
<osid>
<attribute name="OS"><value>FreeBSD</value></attribute>
<attribute name="description"><value>Frisbee (FreeBSD) in an MFS</value></attribute>
<attribute name="features"><value>ping,ssh,ipod,isup</value></attribute>
<attribute name="mfs"><value>1</value></attribute>
<attribute name="mustclean"><value>0</value></attribute>
<attribute name="op_mode"><value>RELOAD</value></attribute>
<attribute name="osname"><value>FRISBEE-MFS</value></attribute>
<attribute name="path"><value>/tftpboot/frisbee</value></attribute>
<attribute name="pid"><value>emulab-ops</value></attribute>
<attribute name="reboot_waittime"><value>150</value></attribute>
<attribute name="shared"><value>1</value></attribute>
<attribute name="version"><value>6.2</value></attribute>
</osid>
<osid>
<attribute name="OS"><value>FreeBSD</value></attribute>
<attribute name="description"><value>FreeBSD on the Operations Node</value></attribute>
......@@ -32,19 +18,6 @@
<attribute name="shared"><value>1</value></attribute>
<attribute name="version"><value>4.X</value></attribute>
</osid>
<osid>
<attribute name="OS"><value>FreeBSD</value></attribute>
<attribute name="description"><value>IPFW Firewall</value></attribute>
<attribute name="features"><value>ping,ssh,ipod,isup,veths,veth-ne,veth-en,mlinks,vlans</value></attribute>
<attribute name="magic"><value>FreeBSD</value></attribute>
<attribute name="mustclean"><value>1</value></attribute>
<attribute name="nextosid"><value>emulab-ops,FBSD410-STD</value></attribute>
<attribute name="op_mode"><value>NORMAL</value></attribute>
<attribute name="osname"><value>FW-IPFW</value></attribute>
<attribute name="pid"><value>emulab-ops</value></attribute>
<attribute name="reboot_waittime"><value>150</value></attribute>
<attribute name="shared"><value>1</value></attribute>
</osid>
<osid>
<attribute name="OS"><value>FreeBSD</value></attribute>
<attribute name="description"><value>IPFW2 Firewall</value></attribute>
......@@ -83,18 +56,6 @@
<attribute name="shared"><value>0</value></attribute>
<attribute name="version"><value>0.00</value></attribute>
</osid>
<osid>
<attribute name="OS"><value>FreeBSD</value></attribute>
<attribute name="description"><value>Any Version of FreeBSD</value></attribute>
<attribute name="features"><value>ping,ssh,ipod,isup,veths,veth-ne,veth-en,mlinks,linktest,linkdelays,vlans</value></attribute>
<attribute name="magic"><value>FreeBSD</value></attribute>
<attribute name="mustclean"><value>1</value></attribute>
<attribute name="op_mode"><value>NORMAL</value></attribute>
<attribute name="osname"><value>FBSD-STD</value></attribute>
<attribute name="pid"><value>emulab-ops</value></attribute>
<attribute name="reboot_waittime"><value>150</value></attribute>
<attribute name="shared"><value>1</value></attribute>
</osid>
<osid>
<attribute name="OS"><value>FreeBSD</value></attribute>
<attribute name="description"><value>NewNode (FreeBSD) in an MFS</value></attribute>
......@@ -109,20 +70,6 @@
<attribute name="shared"><value>1</value></attribute>
<attribute name="version"><value>6.2</value></attribute>
</osid>
<osid>
<attribute name="OS"><value>FreeBSD</value></attribute>
<attribute name="description"><value>Generic OSID for jailed nodes</value></attribute>
<attribute name="features"><value>ping,ssh,isup,linktest</value></attribute>
<attribute name="magic"><value></value></attribute>
<attribute name="mustclean"><value>0</value></attribute>
<attribute name="nextosid"><value>emulab-ops,FBSD-STD</value></attribute>
<attribute name="op_mode"><value>PCVM</value></attribute>
<attribute name="osname"><value>FBSD-JAIL</value></attribute>
<attribute name="pid"><value>emulab-ops</value></attribute>
<attribute name="reboot_waittime"><value>90</value></attribute>
<attribute name="shared"><value>1</value></attribute>
<attribute name="version"><value>4.X</value></attribute>
</osid>
<osid>
<attribute name="OS"><value>Linux</value></attribute>
<attribute name="description"><value>Any of RedHat Linux</value></attribute>
......@@ -149,6 +96,59 @@
<attribute name="shared"><value>1</value></attribute>
<attribute name="version"><value>6.2</value></attribute>
</osid>
<osid>
<attribute name="OS"><value>FreeBSD</value></attribute>
<attribute name="description"><value>Frisbee (FreeBSD) in an MFS</value></attribute>
<attribute name="features"><value>ping,ssh,ipod,isup</value></attribute>
<attribute name="mfs"><value>1</value></attribute>
<attribute name="mustclean"><value>0</value></attribute>
<attribute name="op_mode"><value>RELOAD</value></attribute>
<attribute name="osname"><value>FRISBEE-MFS</value></attribute>
<attribute name="path"><value>/tftpboot/frisbee</value></attribute>
<attribute name="pid"><value>emulab-ops</value></attribute>
<attribute name="reboot_waittime"><value>150</value></attribute>
<attribute name="shared"><value>1</value></attribute>
<attribute name="version"><value>6.2</value></attribute>
</osid>
<osid>
<attribute name="OS"><value>FreeBSD</value></attribute>
<attribute name="description"><value>IPFW Firewall</value></attribute>
<attribute name="features"><value>ping,ssh,ipod,isup,veths,veth-ne,veth-en,mlinks,vlans</value></attribute>
<attribute name="magic"><value>FreeBSD</value></attribute>
<attribute name="mustclean"><value>1</value></attribute>
<attribute name="nextosid"><value>emulab-ops,FBSD410-STD</value></attribute>
<attribute name="op_mode"><value>NORMAL</value></attribute>
<attribute name="osname"><value>FW-IPFW</value></attribute>
<attribute name="pid"><value>emulab-ops</value></attribute>
<attribute name="reboot_waittime"><value>150</value></attribute>
<attribute name="shared"><value>1</value></attribute>
</osid>
<osid>
<attribute name="OS"><value>FreeBSD</value></attribute>
<attribute name="description"><value>Any Version of FreeBSD</value></attribute>
<attribute name="features"><value>ping,ssh,ipod,isup,veths,veth-ne,veth-en,mlinks,linktest,linkdelays,vlans</value></attribute>
<attribute name="magic"><value>FreeBSD</value></attribute>
<attribute name="mustclean"><value>1</value></attribute>
<attribute name="op_mode"><value>NORMAL</value></attribute>
<attribute name="osname"><value>FBSD-STD</value></attribute>
<attribute name="pid"><value>emulab-ops</value></attribute>
<attribute name="reboot_waittime"><value>150</value></attribute>
<attribute name="shared"><value>1</value></attribute>
</osid>
<osid>
<attribute name="OS"><value>FreeBSD</value></attribute>
<attribute name="description"><value>Generic OSID for jailed nodes</value></attribute>
<attribute name="features"><value>ping,ssh,isup,linktest</value></attribute>
<attribute name="magic"><value></value></attribute>
<attribute name="mustclean"><value>0</value></attribute>
<attribute name="nextosid"><value>emulab-ops,FBSD-STD</value></attribute>
<attribute name="op_mode"><value>PCVM</value></attribute>
<attribute name="osname"><value>FBSD-JAIL</value></attribute>
<attribute name="pid"><value>emulab-ops</value></attribute>
<attribute name="reboot_waittime"><value>90</value></attribute>
<attribute name="shared"><value>1</value></attribute>
<attribute name="version"><value>4.X</value></attribute>
</osid>
<image>
<attribute name="default_osid"><value>emulab-ops,FC6-STD</value></attribute>
<attribute name="description"><value>FreeBSD 6.2 and Fedora Core 6 combo image</value></attribute>
......@@ -198,6 +198,21 @@
<attribute name="shared"><value>0</value></attribute>
<attribute name="version"><value>6.2</value></attribute>
</image>
<image>
<attribute name="OS"><value>Linux</value></attribute>
<attribute name="description"><value>Ubuntu 10.04.1 32-bit (Lucid Lynx)</value></attribute>
<attribute name="gid"><value>emulab-ops</value></attribute>
<attribute name="global"><value>1</value></attribute>
<attribute name="imagename"><value>UBUNTU10-STD</value></attribute>
<attribute name="loadpart"><value>2</value></attribute>
<attribute name="mbr_version"><value>2</value></attribute>
<attribute name="op_mode"><value>NORMALv2</value></attribute>
<attribute name="osfeatures"><value>ping,ssh,ipod,isup,linktest</value></attribute>
<attribute name="path"><value>/usr/testbed/images/UBUNTU10-STD.ndz</value></attribute>
<attribute name="pid"><value>emulab-ops</value></attribute>
<attribute name="shared"><value>0</value></attribute>
<attribute name="version"><value>10</value></attribute>
</image>
<image>
<attribute name="OS"><value>Fedora</value></attribute>
<attribute name="description"><value>Emulab Standard Fedora Core 6 image.</value></attribute>
......
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2007-2011 University of Utah and the Flux Group.
# Copyright (c) 2007-2012 University of Utah and the Flux Group.
# All rights reserved.
#
use English;
......@@ -37,7 +37,8 @@ my %imagenames = (
"1" => ['FBSD410+RHL90-STD', 'FBSD410-STD', 'RHL90-STD', 'FBSD410-IPFW2'],
# XXX note that the FBSD410* images may not work on all HW but are
# included here to resolve nextosid entries for FW-IPFW and FBSD-JAIL
"2" => ['FBSD62+FC6-STD', 'FBSD62-STD', 'FC6-STD', 'FBSD410-STD', 'FBSD410-IPFW2'],
"2" => ['FBSD62+FC6-STD', 'FBSD62-STD', 'FC6-STD', 'FBSD410-STD',
'FBSD410-IPFW2', 'UBUNTU10-STD'],
);
my @osnames = ('FREEBSD-MFS', 'FRISBEE-MFS', 'NEWNODE-MFS',
......
......@@ -188,7 +188,8 @@ elsif ($server eq "boss") {
#
'boss/dhcpd', 'boss/named', 'boss/flyspray',
'boss/firstuser', 'boss/checkupuser', 'boss/wikidocs',
'boss/mfs', 'boss/experiments',
'boss/mfs', 'boss/images', 'boss/experiments',
'boss/protogeni'
);
}
elsif ($server eq "fs") {
......
#
#
#
use strict;
use libinstall;
use installvars;
my $DESCRIPTORS = "$TOP_SRCDIR/install/descriptors-v2.xml";
sub Install($$$)
{
my ($server, $isupdate, $impotent) = @_;
# Replace if this script does an update for ip/domain.
return 0
if ($isupdate);
Phase "IDs", "Setting up Image and OS ids", sub {
#
# Load the descriptors into the DB. Inside an elabinelab these are
# already loaded, but the script will just skip over them without
# raising an error.
#
Phase "descriptors", "Loading the Image and OS IDS", sub {
ExecQuietFatal("cd $TOP_OBJDIR/install; ".
" $SUDO -u $PROTOUSER $WAP ".
" perl load-descriptors $DESCRIPTORS");
};
PhaseSucceed("done");
};
return 0;
}
# Local Variables:
# mode:perl
# End:
......@@ -6,44 +6,42 @@ use libinstall;
use installvars;
use File::stat;
$sb = stat($filename);
printf "File is %s, size is %s, perm %04o, mtime %s\n",
$filename, $sb->size, $sb->mode & 07777,
scalar localtime $sb->mtime;
my $INITCERTS = "$PREFIX/sbin/protogeni/initcerts";
sub Install($$$)
{
my ($server, $isupdate, $impotent) = @_;
# Do nothing unless updating; protogeni has its own install.
return 0
if (! $isupdate);
Phase "protogeni", "Updating protogeni subsystem", sub {
if ($isupdate) {
Phase "protogeni", "Updating protogeni subsystem", sub {
PhaseSkip("Protogeni not enabled")
if (! $PGENISUPPORT);
PhaseSkip("Certificates not modified")
if (PhaseWasSkipped("sslcerts"));
#
# Since the certs were regenerated, need to send the new CA
# to the clearinghouse and then reregister the new PG certs.
#
unlink("$ETCDIR/.federated");
unlink("$ETCDIR/.protogeni_federated");
unlink("$ETCDIR/.protogeni_registered");
#
# Everything is handled in the protogeni code, including backup.
#
ExecQuietFatal("$INITCERTS -r -k");
PhaseSucceed("Protogeni certificates updated");
};
return 0;
}
Phase "protogeni", "Installing protogeni subsystem", sub {
PhaseSkip("Protogeni not enabled")
if (! $PGENISUPPORT);
PhaseSkip("Certificates not modified")
if (PhaseWasSkipped("sslcerts"));
#
# Since the certs were regenerated, need to send the new CA
# to the clearinghouse and then reregister the new PG certs.
#
unlink("$ETCDIC/.federated");
unlink("$ETCDIC/.protogeni_federated");
unlink("$ETCDIC/.protogeni_registered");
#
# Everything is handled in the protogeni code, including backup.
#
ExecQuietFatal("$INITCERTS -r -k");
PhaseSucceed("Protogeni certificates updated");
ExecQuietFatal("cd $TOP_OBJDIR/protogeni/scripts; perl ./initsite");
PhaseSucceed("Protogeni installed");
};
return 0;
}
......
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2010-2011 University of Utah and the Flux Group.
# Copyright (c) 2010-2012 University of Utah and the Flux Group.
# All rights reserved.
#
use strict;
......@@ -142,12 +142,18 @@ if ($SRCDIR =~ /^\//) {
}
my @INCDIRS = ("-I${objdir}", "-I${objdir}/../tbsetup",
"-I${objdir}/../db", "-I${objdir}/../event/lib",
"-I${objdir}/../db", "-I${objdir}/../event/lib",
"-I${objdir}/../clientside/lib/event",
"-I${objdir}/../clientside/lib/libtb",
"-I${abssrcdir}/tbsetup",
"-I${abssrcdir}/install",
"-I${abssrcdir}/clientside/lib/event",
# To catch a few extra things that do not normally change.
"-I@prefix@/lib"
);
if ($PGENISUPPORT) {
@INCDIRS = (@INCDIRS, "-I${objdir}/../protogeni/lib");
}
# Chicken or Egg.
# XXX only set specific fields as the ns_include field may not be there yet.
......
#
# GENIPUBLIC-COPYRIGHT
# Copyright (c) 2008-2011 University of Utah and the Flux Group.
# Copyright (c) 2008-2012 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -9,6 +9,7 @@ TESTBED_SRCDIR = @top_srcdir@
OBJDIR = ..
SUBDIR = protogeni
RSPECGENI = $(SRCDIR)/rspec-geni/.git
ELABINELAB = @ELABINELAB@
include $(OBJDIR)/Makeconf
......@@ -27,15 +28,17 @@ install:
@$(MAKE) -C rspec-emulab install
@$(MAKE) -C test install
check-submodule:
check-submodule:
@if [ ! -e "rspec-emulab" ]; then \
echo '*** rspec-emulab does not exist; you need to reconfigure!'; \
false; \
fi
ifeq ($(ELABINELAB),0)
@if [ ! -e "$(RSPECGENI)" ]; then \
echo '*** rspec-geni has not been updated; you need to reconfigure!'; \
false; \
fi
endif
install-genischemacheck:
@$(MAKE) -C lib install-genischemacheck
......
#!/usr/bin/perl -w
#
# GENIPUBLIC-COPYRIGHT
# Copyright (c) 2008-2010 University of Utah and the Flux Group.
# Copyright (c) 2008-2012 University of Utah and the Flux Group.
# All rights reserved.
#
package GeniDB;
......@@ -44,9 +44,12 @@ $emdbi::DBQUERY_DEBUG = 0;
my $GENI_DBNAME =
(defined($main::GENI_DBNAME) ? $main::GENI_DBNAME : GENISA_DBNAME());
# Default connection.
$dbnum = emdbi::NewTBDBHandle("$GENI_DBNAME")
if (!defined($dbnum));
# Default connection. For boot strapping, check to see of DB actually
# exists before trying to connect.
if (emdbi::DBExists("$GENI_DBNAME")) {
$dbnum = emdbi::NewTBDBHandle("$GENI_DBNAME")
if (!defined($dbnum));
}
#
# But provide a way to change who the default DB is. Return old default.
......
......@@ -33,7 +33,9 @@ my $PGENISUPPORT = @PROTOGENI_SUPPORT@;
my $PROTOGENI_RPCNAME = "@PROTOGENI_RPCNAME@";
my $PROTOGENI_RPCPORT = "@PROTOGENI_RPCPORT@";
my $OUTERBOSS_XMLRPCPORT = "@OUTERBOSS_XMLRPCPORT@";
my $PROTOGENI_WEBSITE = "@PROTOGENI_WEBSITE@";
my $PROTOGENI_WEBSITE = "@PROTOGENI_WEBSITE@";
my $PROTOGENI_GENIRACK = @PROTOGENI_GENIRACK@;
my $PROTOGENI_PASSWORD = "@PROTOGENI_PASSWORD@";
my $PROTOGENI_URL = "@PROTOGENI_URL@";
my $geniuserid = "geniuser";
my $geniprojid = "GeniSlices";
......@@ -344,38 +346,6 @@ Phase "rcconf", "Updating $RCCONF", sub {
AppendToFileFatal($RCCONF, "$APACHE_FLAGS=\"-DSSL -DPGENI\"");
};
#
# On the clients, we have to get the bundle from the CH website and
# then break it up for xmlsec (see above). We use a script for this
# since the clients need to do this everytime a new client is added.
# This script restarts apache.
#
if (!$asch) {
Phase "getcacerts", "Getting current CA bundle", sub {
ExecQuietFatal("$GETCACERTS -l -p");
};
#
# This cron entry will autoupdate the CA/CRL certs by getting them from
# the CH website.
#
Phase "crontab", "Updating $CRONTAB", sub {
DoneIfEdited($CRONTAB);
AppendToFileFatal($CRONTAB,
"13 4 * * * root $GETCACERTS");
};
}
else {
#
# But on the clearinghouse, we have to generate the CRL bundle for
# downloading by remote sites.
#
Phase "crontab", "Updating $CRONTAB", sub {
DoneIfEdited($CRONTAB);
AppendToFileFatal($CRONTAB,
"10 4 * * * root $GENCRLBUNDLE");
};
}
#
# user/project that slices (experiments) belong to.
#
......@@ -389,11 +359,19 @@ Phase "geniuser", "Creating user $geniuserid", sub {
ExecQuietFatal("$SUDO -u $PROTOUSER ".
"$WAP $NEWUSER $TB/etc/protogeni/geniuser.xml");
ExecQuietFatal("$SUDO -u $PROTOUSER $WAP $TBACCT verify $geniuserid");
$geniuser = User->Lookup($geniuserid);
PhaseFail("$geniuserid did not create")
PhaseFail("$geniuserid did not create properly")
if (!defined($geniuser));
if ($PROTOGENI_PASSWORD ne "") {
my @salt_chars = ('a'..'z','A'..'Z','0'..'9');
my $salt = $salt_chars[rand(@salt_chars)] .
$salt_chars[rand(@salt_chars)];
my $encpass = crypt($PROTOGENI_PASSWORD, "\$1\$${salt}");
$geniuser->SetPassword($encpass, "date_add(now(), interval 10 year)");
}
ExecQuietFatal("$SUDO -u $PROTOUSER $WAP $TBACCT verify $geniuserid");
};
my $geniproj = Project->Lookup($geniprojid);
......@@ -440,7 +418,9 @@ Phase "chown", "Changing ownership on dirs", sub {
Phase "dbstuff", "Adding a few things to Emulab DB", sub {
#
# Need this fake type for now. It would be unusual if it did not exist.
# Need this fake type for now.
#
# It would be unusual if this OSID did not exist.
#
my $osinfo = OSinfo->Lookup(TBOPSPID(), "RHL-STD");
PhaseFail("RHL-STD does not exist")
......@@ -498,6 +478,38 @@ Phase "initcerts", "Creating PG certificates", sub {
ExecQuietFatal("$INITCERTS");
};
#
# On the clients, we have to get the bundle from the CH website and
# then break it up for xmlsec (see above). We use a script for this
# since the clients need to do this everytime a new client is added.
# This script restarts apache.
#
if (!$asch) {
Phase "getcacerts", "Getting current CA bundle", sub {
ExecQuietFatal("$GETCACERTS -l -p");
};
#
# This cron entry will autoupdate the CA/CRL certs by getting them from
# the CH website.
#
Phase "crontab", "Updating $CRONTAB", sub {
DoneIfEdited($CRONTAB);
AppendToFileFatal($CRONTAB,
"13 4 * * * root $GETCACERTS");
};
}
else {
#
# But on the clearinghouse, we have to generate the CRL bundle for
# downloading by remote sites.
#
Phase "crontab", "Updating $CRONTAB", sub {
DoneIfEdited($CRONTAB);
AppendToFileFatal($CRONTAB,
"10 4 * * * root $GENCRLBUNDLE");
};
}
if (!$asch) {
#
# Register the certificates at the clearinghouse.
......
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