installvars.pm.in 14.9 KB
Newer Older
1 2
#!/usr/bin/perl -w
#
3
# Copyright (c) 2003-2018 University of Utah and the Flux Group.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
# 
# {{{EMULAB-LICENSE
# 
# This file is part of the Emulab network testbed software.
# 
# This file is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
# 
# This file is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public
# License for more details.
# 
# You should have received a copy of the GNU Affero General Public License
# along with this file.  If not, see <http://www.gnu.org/licenses/>.
# 
# }}}
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
#
#
# A big set of variables that are common to the installation scripts.
#
package installvars;
use strict;
# Avoid having to predefine everything.
no strict "vars";
use Exporter;
use vars qw(@ISA $SYMLIST);
@ISA    = qw(Exporter);
@EXPORT = qw();

# These are set in the driver script from command line args.
$domakes     = 0;
$packagedir  = "";
$password    = undef;

# Version of FreeBSD.
$FBSD_MAJOR = 4;
$FBSD_MINOR = 10;
if (`uname -r` =~ /^(\d+)\.(\d+)/) {
    $FBSD_MAJOR = $1;
    $FBSD_MINOR = $2;
}
else {
    die("Could not determine what version of FreeBSD you are running!\n");
}
51 52 53 54 55 56 57
$FBSD_ARCH = "i386";
if (`uname -m` =~ /^(\S+)$/) {
    $FBSD_ARCH = $1;
}
else {
    die("Could not determine what architecutre FreeBSD is running on!\n");
}
58 59 60 61 62 63 64 65 66

#
# The meta-ports (name and version) that drag in all the dependancies for
# a boss node. These are OS dependent as we upgrade.
#
$BOSS_PORT = "emulab-boss-1.8";
$OPS_PORT  = "emulab-ops-1.4"; 
$FS_PORT   = "emulab-fs-1.4";
if ($FBSD_MAJOR > 4) {
Leigh Stoller's avatar
Leigh Stoller committed
67 68 69 70 71 72 73 74 75 76 77
    if ($FBSD_MAJOR == 11) {
	if ($FBSD_MINOR <= 1) {
	    $BOSS_PORT = "emulab-boss-7.1";
	    $OPS_PORT = "emulab-ops-7.1";
	    $FS_PORT = "emulab-fs-7.1";
	}
        else {
	    $BOSS_PORT = "emulab-boss-7.2";
	    $OPS_PORT = "emulab-ops-7.2";
	    $FS_PORT = "emulab-fs-7.2";
	}
Mike Hibler's avatar
Mike Hibler committed
78 79 80 81 82
    } elsif ($FBSD_MAJOR == 10 && $FBSD_MINOR > 2) {
	$BOSS_PORT = "emulab-boss-6.3";
	$OPS_PORT = "emulab-ops-6.3";
	$FS_PORT = "emulab-fs-6.3";
    } elsif ($FBSD_MAJOR == 10 && $FBSD_MINOR > 1) {
83 84 85 86
	$BOSS_PORT = "emulab-boss-6.2";
	$OPS_PORT = "emulab-ops-6.2";
	$FS_PORT = "emulab-fs-6.2";
    } elsif ($FBSD_MAJOR == 10 && $FBSD_MINOR > 0) {
87 88 89 90
	$BOSS_PORT = "emulab-boss-6.1";
	$OPS_PORT = "emulab-ops-6.1";
	$FS_PORT = "emulab-fs-6.1";
    } elsif ($FBSD_MAJOR > 9) {
91 92 93 94
	$BOSS_PORT = "emulab-boss-6.0";
	$OPS_PORT = "emulab-ops-6.0";
	$FS_PORT = "emulab-fs-6.0";
    } elsif ($FBSD_MAJOR == 9 && $FBSD_MINOR > 1) {
95 96 97 98
	$BOSS_PORT = "emulab-boss-5.1";
	$OPS_PORT = "emulab-ops-5.1";
	$FS_PORT = "emulab-fs-5.1";
    } elsif ($FBSD_MAJOR > 8 || ($FBSD_MAJOR == 8 && $FBSD_MINOR > 2)) {
99 100 101 102
	$BOSS_PORT = "emulab-boss-5.0";
	$OPS_PORT = "emulab-ops-5.0";
	$FS_PORT = "emulab-fs-5.0";
    } elsif ($FBSD_MAJOR > 7) {
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
	$BOSS_PORT = "emulab-boss-4.0";
	$OPS_PORT = "emulab-ops-4.0";
	$FS_PORT = "emulab-fs-4.0";
    } elsif ($FBSD_MAJOR == 7 && $FBSD_MINOR > 2) {
	$BOSS_PORT = "emulab-boss-3.1";
	$OPS_PORT = "emulab-ops-3.1";
	$FS_PORT = "emulab-fs-3.1";
    } elsif ($FBSD_MAJOR == 7) {
	$BOSS_PORT = "emulab-boss-3.0";
	$OPS_PORT = "emulab-ops-3.0";
	$FS_PORT = "emulab-fs-3.0";
    } elsif ($FBSD_MAJOR == 6 && $FBSD_MINOR > 2) {
	$BOSS_PORT = "emulab-boss-2.1";
	$OPS_PORT = "emulab-ops-2.1";
	$FS_PORT = "emulab-fs-2.1";
    } else {
	$BOSS_PORT = "emulab-boss-2.0";
	$OPS_PORT = "emulab-ops-2.0";
	$FS_PORT = "emulab-fs-2.0";
    }
}

# PHP5 is the only alternative at the moment and only for newer OSes
$PHP_VERSION = 4;
$PHP_PORT = "php4-extensions-1.0";
if ($FBSD_MAJOR > 7 || ($FBSD_MAJOR == 7 && $FBSD_MINOR > 2)) {
    $PHP_VERSION = 5;
130
    # there is no longer an explict extensions package
131 132
    if ($FBSD_MAJOR == 10 && $FBSD_MINOR > 0) {
	$PHP_PORT = "php56";
133
    } elsif ($FBSD_MAJOR > 9 || ($FBSD_MAJOR == 9 && $FBSD_MINOR > 1)) {
134 135
	$PHP_PORT = "php5-extensions-1.7";
    } elsif ($FBSD_MAJOR > 8 || ($FBSD_MAJOR == 8 && $FBSD_MINOR > 2)) {
136 137
	$PHP_PORT = "php5-extensions-1.6";
    } elsif ($FBSD_MAJOR > 7) {
138
	$PHP_PORT = "php5-extensions-1.4";
139
    } else {
140 141 142 143 144 145
	$PHP_PORT = "php5-extensions-1.3";
    }
}

# XXX temporary for tftp
$TFTPD_PKG	  = "emulab-tftp-hpa-0.48";
Mike Hibler's avatar
Mike Hibler committed
146 147 148
if ($FBSD_MAJOR > 10 || ($FBSD_MAJOR == 10 && $FBSD_MINOR > 0)) {
    $TFTPD_PKG = "emulab-tftp-hpa-5.2";
}
149

150
# XXX temporary for perl DBD mysql access (only needed for FBSD7 and below)
151 152 153 154 155 156 157 158 159 160 161 162 163 164
$P5DBD_PKG	  = "p5-DBD-mysql50-3.0002";

# Lots of patches
$STL_PATCH		= "$main::TOP_SRCDIR/patches/g++.patch";
$M2CRYPTO_PATCH		= "$main::TOP_SRCDIR/patches/m2crypto.patch";
$MYSQL_PM_PATCH		= "$main::TOP_SRCDIR/patches/Mysql.pm.patch";
$PHP4_PATCH		= "$main::TOP_SRCDIR/patches/php4-Makefile.patch";
$SELFLOAD_PATCH		= "$main::TOP_SRCDIR/patches/SelfLoader.patch";

#
# Version dependent python-fu 
#
$PYM2_PKG = "py25-m2crypto-0.19.1";
$PY_VER   = "python2.5";
165 166 167 168
if ($FBSD_MAJOR > 10 || ($FBSD_MAJOR == 10 && $FBSD_MINOR > 0)) {
    $PYM2_PKG = "py27-m2crypto-0.22.3";
    $PY_VER = "python2.7";
} elsif ($FBSD_MAJOR > 9) {
169 170 171
    $PYM2_PKG = "py27-m2crypto-0.21.1_1";
    $PY_VER = "python2.7";
} elsif ($FBSD_MAJOR > 8 || ($FBSD_MAJOR == 8 && $FBSD_MINOR > 2)) {
172 173 174
    $PYM2_PKG = "py27-m2crypto-0.21.1";
    $PY_VER = "python2.7";
} elsif ($FBSD_MAJOR > 7 || ($FBSD_MAJOR == 7 && $FBSD_MINOR > 2)) {
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193
    $PYM2_PKG = "py26-m2crypto-0.20";
    $PY_VER = "python2.6";
}
# XXX temporary until someone extracts their head from the dark regions
$EASYINSTALL		= "/usr/local/bin/easy_install";

# These names are for the scripts.
$BOSS_SERVERNAME	= "boss";
$OPS_SERVERNAME 	= "ops";
$FS_SERVERNAME		= "fs";

# Should be configure variable
$TBADMINGID		= 101;

$TBROOT			= "@prefix@";
$PREFIX			= $TBROOT;

$MAINSITE		= @TBMAINSITE@;
$PGENISUPPORT		= @PROTOGENI_SUPPORT@;
Leigh Stoller's avatar
Leigh Stoller committed
194
$PROTOGENI_GENIRACK     = @PROTOGENI_GENIRACK@;
195
$CONFIG_TARGETSYS       = @CONFIG_TARGETSYS@;
196
$TARGETSYS_TARGET       = "@TARGETSYS_TARGET@";
197
$PORTAL_ENABLE          = @PORTAL_ENABLE@;
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216
$ELABINELAB		= @ELABINELAB@;
$DBNAME			= "@TBDBNAME@";
$ERRORLOG_DBNAME	= "@TBERRORLOGDBNAME@";
$FRISADDR		= '@FRISEBEEMCASTADDR@';

$HAVE_XERCES		= "@HAVE_XERCES@";
$MAILMANSUPPORT		= @MAILMANSUPPORT@;
$WINSUPPORT		= @WINSUPPORT@;

$OURDOMAIN		= '@OURDOMAIN@';
$USERNODE		= '@USERNODE@';
$FSNODE			= '@FSNODE@';
$BOSSNODE		= '@BOSSNODE@';
$BOSSNODE_IP		= '@BOSSNODE_IP@';
$USERNODE_IP		= '@USERNODE_IP@';
$FSNODE_IP		= '@FSNODE_IP@';
$CONTROL_NETWORK	= "@CONTROL_NETWORK@";
$CONTROL_NETMASK	= "@CONTROL_NETMASK@";
$PUBLIC_NETMASK		= "@PUBLIC_NETMASK@";
217
$NTPSERVER		= "@NTPSERVER@";
218 219
$LOGFACIL		= '@TBLOGFACIL@';
$QUOTA_FSLIST		= '@FS_WITH_QUOTAS@';
Leigh Stoller's avatar
Leigh Stoller committed
220
$OURTIMEZONE	        = "@OURTIMEZONE@";
221
$NODECONSOLE		= "@NODECONSOLE@";
Leigh Stoller's avatar
Leigh Stoller committed
222
$MFSVERSION		= "@MFSVERSION@";
223 224 225 226 227

$LOGDIR			= "$TBROOT/log";
$ETCDIR			= "$PREFIX/etc";
$LIBDIR			= "$PREFIX/lib";
$WAP			= "$TBROOT/sbin/withadminprivs";
Leigh Stoller's avatar
Leigh Stoller committed
228
$TESTBED_CONTROL	= "$TBROOT/sbin/testbed-control";
229 230 231 232 233 234 235 236 237

$ELVIN_COMPAT		= @ELVIN_COMPAT@;
$MAILMANSUPPORT		= @MAILMANSUPPORT@;
$CVSSUPPORT		= @CVSSUPPORT@;
$BUGDBSUPPORT		= @BUGDBSUPPORT@;
$WIKISUPPORT		= @WIKISUPPORT@;
$NOSHAREDFS		= @NOSHAREDFS@;
# Are we a VM on boss?
$OPSVM_ENABLE		= @OPSVM_ENABLE@;
238 239
# mrouted no longer needed; replaced by IGMP querier in mfrisbeed
$NEEDMROUTED		= 0;
240
$ARCHSUPPORT		= @ARCHIVESUPPORT@;
241
$BROWSER_CONSOLE_ENABLE = @BROWSER_CONSOLE_ENABLE@;
242 243
$WITHZFS		= @WITHZFS@;
$WITHAMD		= @WITHAMD@;
244
$IMAGEUPLOADTOFS	= @IMAGEUPLOADTOFS@;
245

246 247 248 249 250 251 252 253 254 255 256 257
#
# Python/Perl paths
#
# EMULAB* are the paths we expect and use in '#!'
# PORT* are the paths that the ports install and should always exist
#
# We make sure the former is symlinked to the latter.
#
$EMULAB_PERL_PATH	= "/usr/bin/perl";
$EMULAB_PYTHON_PATH	= "/usr/local/bin/python";
$PORT_PERL_PATH		= "/usr/local/bin/perl5";
$PORT_PYTHON_PATH	= "/usr/local/bin/python2";
258
$PORT_PYTHON_PATH2	= "/usr/local/bin/python2.7";
259

260 261 262 263 264
#
# Some programs we use
#
$CHGRP			= "/usr/bin/chgrp";
$CHMOD			= "/bin/chmod";
Leigh Stoller's avatar
Leigh Stoller committed
265
$MKDIR			= "/bin/mkdir";
266 267 268 269
$TOUCH			= "/usr/bin/touch";
$CHOWN			= "/usr/sbin/chown";
$PW			= "/usr/sbin/pw";
$PATCH			= "/usr/bin/patch";
Mike Hibler's avatar
Mike Hibler committed
270 271 272
if ($FBSD_MAJOR >= 10) {
    $PATCH		.= " --posix";
}
273 274 275 276 277 278 279 280 281 282 283 284 285 286 287
$CAT			= "/bin/cat";
$NEWALIASES		= "/usr/bin/newaliases";
$SH			= "/bin/sh";
$PWD			= "/bin/pwd";
$CP			= "/bin/cp";
$MV			= "/bin/mv";
$ENV			= "/usr/bin/env";
$MOUNT			= "/sbin/mount";
$TAR			= "/usr/bin/tar";
$MD5			= "/sbin/md5";
$SSH_KEYGEN		= "/usr/bin/ssh-keygen";
$SUDO			= "/usr/local/bin/sudo";
$GMAKE			= "/usr/local/bin/gmake";
$MYSQL			= "/usr/local/bin/mysql";
$QUOTAON		= "/usr/sbin/quotaon";
288 289
$SSH_INIT		= "/usr/bin/ssh -2";
$SCP_INIT		= "/usr/bin/scp -2";
290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306
$SSH			= "/usr/bin/ssh -2";
$SCP			= "/usr/bin/scp -2";
#
# XXX keep 4.x ElabInElab install limping along...
#
if ($FBSD_MAJOR == 4) {
    $SCP_INIT = "/usr/bin/scp -oProtocol=1";
    $SCP =      "/usr/bin/scp -oProtocol=2";
}

$PORTSDIR		= "/usr/ports";
$PORTSMISCDIR		= "$PORTSDIR/misc";
$LIST_DIR		= "/etc/mail/lists";
$ALIASES_FILE           = "/etc/mail/aliases";
$VARRUN			= "/var/run";
$RCDIR			= "/usr/local/etc/rc.d";
$NAMED_DIR		= "/etc/namedb";
307
$RESOLVECONF		= "/etc/resolv.conf";
308 309 310 311 312 313 314 315 316 317 318 319 320 321
$FSTAB			= "/etc/fstab";
$RCCONF			= "/etc/rc.conf";
$HOSTS			= "/etc/hosts";
$LOCAL_HOSTNAMES	= "/etc/mail/local-host-names";
$EXPORTS_FILE		= "/etc/exports";
$EXPORTS_HEAD		= "$EXPORTS_FILE.head";
$SYSLOG_CONF		= "/etc/syslog.conf";
$NEWSYSLOG_CONF		= "/etc/newsyslog.conf";
$SUDOERS		= "/usr/local/etc/sudoers";
$SSHD_CONFIG		= "/etc/ssh/sshd_config";
$CRONTAB		= "/etc/crontab";
$TIPLOG_DIR		= "/var/log/tiplogs";
$OPSWWWDIR		= "/usr/local/www/data";
$WWWDIR			= "$PREFIX/www";
322 323
$TBBASE			= "@TBBASE@";
$THISHOMEBASE           = "@THISHOMEBASE@";
324 325 326 327
$AUTHKEYS		= "/root/.ssh/authorized_keys";
$RCCAPTURE		= "$PREFIX/etc/rc.capture";
$RCLOCAL		= "/etc/rc.local";
$PHP_INI		= "/usr/local/etc/php.ini";
328
$PHP_CONF		= "/usr/local/etc/php.conf";
329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345
$SENDMAIL_CF		= "/etc/mail/sendmail.cf";
$INETD_CONF		= "/etc/inetd.conf";
$ETCSSH			= "/etc/ssh";
$SSH_CONFIG	        = "$ETCSSH/ssh_config";
$LOADER_CONF		= "/boot/loader.conf";
$SYSCTL_CONF		= "/etc/sysctl.conf";

$GROUPROOT		= "@GROUPSROOT_DIR@";
$USERROOT		= "@USERSROOT_DIR@";
$SCRATCHROOT		= "@SCRATCHROOT_DIR@";
$SHAREROOT		= "@SHAREROOT_DIR@";
$PROJROOT		= "@PROJROOT_DIR@";

$TBOPSEMAIL		= "@TBOPSEMAIL@";
$TBTESTSUITEEMAIL	= "@TBTESTSUITEEMAIL@";

# For installing mysqld
346
$MYSQLD			= "/usr/local/libexec/mysqld";
347 348 349 350 351 352
$MYSQLADMIN		= "/usr/local/bin/mysqladmin";
$MYSQLSHOW		= "/usr/local/bin/mysqlshow";
$MYSQLDUMP		= "/usr/local/bin/mysqldump";
$MYSQLINSTALL		= "/usr/local/bin/mysql_install_db";
$MYSQLDBDIR		= "/var/db/mysql";
$MYSQL_LOGDIR		= "$LOGDIR/mysql";
353
$MYSQL_CNF		= "/usr/local/etc/mysql/my.cnf";
354 355 356 357 358 359 360 361 362

$PROTOUSER		= "elabman";
$CHECKUPUSER		= "elabckup";

$INSTALL_APACHE_CONFIG	= "@INSTALL_APACHE_CONFIG@";
$APACHE_VERSION		= "@APACHE_VERSION@";
$APACHE_START_COMMAND	= "@APACHE_START_COMMAND@";
$APACHE_ETCDIR		= "$INSTALL_APACHE_CONFIG";
$HTTPD_CONF		= "$APACHE_ETCDIR/httpd.conf";
363
$HTTPD_GENI_CONF	= "$APACHE_ETCDIR/httpd-geni.conf";
364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386
$APACHE_CERTPEM		= "apache.pem";
$APACHE_KEYPEM		= "apache.key";
$APACHE_CERTFILE	= "$APACHE_ETCDIR/ssl.crt/www.${OURDOMAIN}.crt";
$APACHE_KEYFILE		= "$APACHE_ETCDIR/ssl.key/www.${OURDOMAIN}.key";
$APACHE_CERTPEM_OPS	= "apache-ops.pem";
$APACHE_KEYPEM_OPS	= "apache-ops.key";
$APACHE_CERTFILE_OPS	= "$APACHE_ETCDIR/ssl.crt/${USERNODE}.crt";
$APACHE_KEYFILE_OPS	= "$APACHE_ETCDIR/ssl.key/${USERNODE}.key";

$PROTOGENI_RPCNAME	= "@PROTOGENI_RPCNAME@";
$PROTOGENI_RPCPORT	= "@PROTOGENI_RPCPORT@";
$PROTOGENI_EMAIL        = "@PROTOGENI_EMAIL@";

$DHCPD_CONF		= "/usr/local/etc/dhcpd.conf";
$DHCPD_TEMPLATE		= "/usr/local/etc/dhcpd.conf.template";
$DHCPD_LEASES		= "/var/db/dhcpd.leases";
$DHCPD_MAKECONF		= "$TBROOT/sbin/dhcpd_makeconf";
$NAMED_SETUP		= "$TBROOT/sbin/named_setup";

$BATCHEXP		= "$PREFIX/bin/batchexp";
$ADDPUBKEY		= "$PREFIX/sbin/addpubkey";
$TBACCT			= "$PREFIX/sbin/tbacct";
$GENTOPOFILE		= "$PREFIX/libexec/gentopofile";
387
$UPDATESITEVARS		= "$PREFIX/sbin/update_sitevars";
388
$IMAGEIMPORT            = "$PREFIX/sbin/image_import";
389

Leigh Stoller's avatar
Leigh Stoller committed
390 391
$PROTOUSER_DSAKEY	= "$main::TOP_SRCDIR/install/elabman_dsa.pub";
$PROTOUSER_RSAKEY	= "$main::TOP_SRCDIR/install/elabman_rsa.pub";
392 393 394
$ROOT_PRIVKEY		= "/root/.ssh/id_rsa";
$ROOT_PUBKEY		= "$ROOT_PRIVKEY.pub";
$ROOT_AUTHKEY		= "/root/.ssh/authorized_keys";
395 396
$ROOT_DSA_PRIVKEY	= "/root/.ssh/id_dsa";
$ROOT_DSA_PUBKEY	= "$ROOT_DSA_PRIVKEY.pub";
397

398 399
$INIT_PRIVKEY		= "$main::TOP_SRCDIR/install/id_rsa";
$INIT_PUBKEY		= "$main::TOP_SRCDIR/install/id_rsa.pub";
400 401 402 403 404 405 406 407 408 409 410
$CACERT			= "$TBROOT/etc/emulab.pem";
$EMULAB_PEM		= "emulab.pem";
$CLIENT_PEM		= "client.pem";
$CTRLNODE_PEM		= "ctrlnode.pem";
$ETC_EMULAB_DIR		= "/etc/emulab";

$SMBCONF_FILE		= "/usr/local/etc/smb.conf";
$SMBCONF_HEAD		= "$SMBCONF_FILE.head";

$TFTP_DIR	        = "$PREFIX/tftpboot";
$TFTP_PROJ_DIR		= "$TFTP_DIR/proj";
Leigh Stoller's avatar
Leigh Stoller committed
411
$IMAGEKEYS_DIR	        = "$ETCDIR/image_hostkeys";
412

Leigh Stoller's avatar
Leigh Stoller committed
413
$DEFAULTIMAGESITEVAR    = "general/default_imagename";
414
$IMAGEPASSWORDSITEVAR   = "images/root_password";
Leigh Stoller's avatar
Leigh Stoller committed
415

416 417 418
$MAILMANDIR		= "/usr/local/mailman";
$MAILMANCFG		= "$MAILMANDIR/Mailman/mm_cfg.py";

419
$SHAREDIR		= "@FSDIR_SHARE@";
420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448
$SCRATCHDIR		= "@FSDIR_SCRATCH@";

$OUTERBOSS_XMLRPCPORT   = "@OUTERBOSS_XMLRPCPORT@";

@OPS_NAMES		= ($USERNODE, "users", "ops");
@MAILING_LISTS		= ("@TBOPSEMAIL@","@TBLOGSEMAIL@","@TBWWWEMAIL@",
			   "@TBAPPROVALEMAIL@","@TBAUDITEMAIL@",
			   "@TBSTATEDEMAIL@", "@TBTESTSUITEEMAIL@",
			   "@TBERRORSEMAIL@", "@TBAUTOMAILEMAIL@");
@LOCAL_MAILING_LISTS    = grep(/$OURDOMAIN$/, @MAILING_LISTS);

$USERSVAR_MOUNTPOINT	= "$PREFIX/usersvar";
$OPSDIR_MOUNTPOINT	= "$PREFIX/opsdir";
$OPSVM_MOUNTPOINT	= "@OPSVM_MOUNTPOINT@";

@MOUNTPOINTS		= ($USERROOT, $PROJROOT, $GROUPROOT);
if ($SHAREDIR) {
    push(@MOUNTPOINTS, $SHAREROOT);
}
if ($SCRATCHDIR) {
    push(@MOUNTPOINTS, $SCRATCHROOT);
}

# ElabinElab.
$OUTER_BOSS		 = '@OUTERBOSS_NODENAME@';
if ($OUTER_BOSS eq '') {
    $OUTER_BOSS = "www.emulab.net";
}

449 450 451 452 453 454
# Firewall stuff
$FIREWALL_BOSS		= @FIREWALL_BOSS@;
$FIREWALL_OPS		= @FIREWALL_OPS@;
$FIREWALL_BOSS_RULES    = "/etc/boss.ipfw";
$FIREWALL_OPS_RULES     = "/etc/ops.ipfw";

455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501
sub ISBOSSNODE($)	{ return ($_[0] eq $BOSS_SERVERNAME) ? 1 : 0; }
sub ISOPSNODE($)	{ return ($_[0] eq $OPS_SERVERNAME) ? 1 : 0; }
sub ISFSNODE($)		{ return ($_[0] eq $FS_SERVERNAME) ? 1 : 0; }

#
# Is the given server the FS
#
sub ISFS($)
{
    my ($server) = @_;

    if ($server eq $BOSS_SERVERNAME) {
	return ($BOSSNODE_IP eq $FSNODE_IP) ? 1 : 0;
    }
    elsif ($server eq $OPS_SERVERNAME) {
	return ($USERNODE_IP eq $FSNODE_IP) ? 1 : 0;
    }
    elsif ($server eq $FS_SERVERNAME) {
	return 1;
    }
    return 0;
}

#
# The point of this code is to export every single symbol in this
# file to the caller, without having to list them all.
#
sub importup($)
{
    my ($caller) = @_;

    no strict 'refs';

    while (my ($name, $symbol) = each %{__PACKAGE__ . '::'}) {
        next if      $name eq 'BEGIN';    # don't export BEGIN blocks
        next if      $name eq 'import';   # don't export this sub

        my $imported = $caller . '::' . $name;
        *{ $imported } = \*{ $symbol };
    }
}

sub import {
    return importup(caller());
}

1;