installvars.pm.in 14.7 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) {
Mike Hibler's avatar
Mike Hibler committed
67
68
69
70
71
72
73
74
75
    if ($FBSD_MAJOR > 10) {
	$BOSS_PORT = "emulab-boss-7.1";
	$OPS_PORT = "emulab-ops-7.1";
	$FS_PORT = "emulab-fs-7.1";
    } 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) {
76
77
78
79
	$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) {
80
81
82
83
	$BOSS_PORT = "emulab-boss-6.1";
	$OPS_PORT = "emulab-ops-6.1";
	$FS_PORT = "emulab-fs-6.1";
    } elsif ($FBSD_MAJOR > 9) {
84
85
86
87
	$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) {
88
89
90
91
	$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)) {
92
93
94
95
	$BOSS_PORT = "emulab-boss-5.0";
	$OPS_PORT = "emulab-ops-5.0";
	$FS_PORT = "emulab-fs-5.0";
    } elsif ($FBSD_MAJOR > 7) {
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
	$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;
123
    # there is no longer an explict extensions package
124
125
    if ($FBSD_MAJOR == 10 && $FBSD_MINOR > 0) {
	$PHP_PORT = "php56";
126
    } elsif ($FBSD_MAJOR > 9 || ($FBSD_MAJOR == 9 && $FBSD_MINOR > 1)) {
127
128
	$PHP_PORT = "php5-extensions-1.7";
    } elsif ($FBSD_MAJOR > 8 || ($FBSD_MAJOR == 8 && $FBSD_MINOR > 2)) {
129
130
	$PHP_PORT = "php5-extensions-1.6";
    } elsif ($FBSD_MAJOR > 7) {
131
	$PHP_PORT = "php5-extensions-1.4";
132
    } else {
133
134
135
136
137
138
	$PHP_PORT = "php5-extensions-1.3";
    }
}

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

143
# XXX temporary for perl DBD mysql access (only needed for FBSD7 and below)
144
145
146
147
148
149
150
151
152
153
154
155
156
157
$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";
158
159
160
161
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) {
162
163
164
    $PYM2_PKG = "py27-m2crypto-0.21.1_1";
    $PY_VER = "python2.7";
} elsif ($FBSD_MAJOR > 8 || ($FBSD_MAJOR == 8 && $FBSD_MINOR > 2)) {
165
166
167
    $PYM2_PKG = "py27-m2crypto-0.21.1";
    $PY_VER = "python2.7";
} elsif ($FBSD_MAJOR > 7 || ($FBSD_MAJOR == 7 && $FBSD_MINOR > 2)) {
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
    $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 B Stoller's avatar
Leigh B Stoller committed
187
$PROTOGENI_GENIRACK     = @PROTOGENI_GENIRACK@;
188
$CONFIG_TARGETSYS       = @CONFIG_TARGETSYS@;
189
$TARGETSYS_TARGET       = "@TARGETSYS_TARGET@";
190
$PORTAL_ENABLE          = @PORTAL_ENABLE@;
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
$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@";
210
$NTPSERVER		= "@NTPSERVER@";
211
212
$LOGFACIL		= '@TBLOGFACIL@';
$QUOTA_FSLIST		= '@FS_WITH_QUOTAS@';
Leigh B Stoller's avatar
Leigh B Stoller committed
213
$OURTIMEZONE	        = "@OURTIMEZONE@";
214
$NODECONSOLE		= "@NODECONSOLE@";
Leigh B Stoller's avatar
Leigh B Stoller committed
215
$MFSVERSION		= "@MFSVERSION@";
216
217
218
219
220

$LOGDIR			= "$TBROOT/log";
$ETCDIR			= "$PREFIX/etc";
$LIBDIR			= "$PREFIX/lib";
$WAP			= "$TBROOT/sbin/withadminprivs";
Leigh B Stoller's avatar
Leigh B Stoller committed
221
$TESTBED_CONTROL	= "$TBROOT/sbin/testbed-control";
222
223
224
225
226
227
228
229
230

$ELVIN_COMPAT		= @ELVIN_COMPAT@;
$MAILMANSUPPORT		= @MAILMANSUPPORT@;
$CVSSUPPORT		= @CVSSUPPORT@;
$BUGDBSUPPORT		= @BUGDBSUPPORT@;
$WIKISUPPORT		= @WIKISUPPORT@;
$NOSHAREDFS		= @NOSHAREDFS@;
# Are we a VM on boss?
$OPSVM_ENABLE		= @OPSVM_ENABLE@;
231
232
# mrouted no longer needed; replaced by IGMP querier in mfrisbeed
$NEEDMROUTED		= 0;
233
$ARCHSUPPORT		= @ARCHIVESUPPORT@;
234
$BROWSER_CONSOLE_ENABLE = @BROWSER_CONSOLE_ENABLE@;
235
236
$WITHZFS		= @WITHZFS@;
$WITHAMD		= @WITHAMD@;
237
$IMAGEUPLOADTOFS	= @IMAGEUPLOADTOFS@;
238

239
240
241
242
243
244
245
246
247
248
249
250
#
# 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";
251
$PORT_PYTHON_PATH2	= "/usr/local/bin/python2.7";
252

253
254
255
256
257
#
# Some programs we use
#
$CHGRP			= "/usr/bin/chgrp";
$CHMOD			= "/bin/chmod";
Leigh B Stoller's avatar
Leigh B Stoller committed
258
$MKDIR			= "/bin/mkdir";
259
260
261
262
$TOUCH			= "/usr/bin/touch";
$CHOWN			= "/usr/sbin/chown";
$PW			= "/usr/sbin/pw";
$PATCH			= "/usr/bin/patch";
Mike Hibler's avatar
Mike Hibler committed
263
264
265
if ($FBSD_MAJOR >= 10) {
    $PATCH		.= " --posix";
}
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
$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";
281
282
$SSH_INIT		= "/usr/bin/ssh -2";
$SCP_INIT		= "/usr/bin/scp -2";
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
$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";
300
$RESOLVECONF		= "/etc/resolv.conf";
301
302
303
304
305
306
307
308
309
310
311
312
313
314
$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";
315
316
$TBBASE			= "@TBBASE@";
$THISHOMEBASE           = "@THISHOMEBASE@";
317
318
319
320
$AUTHKEYS		= "/root/.ssh/authorized_keys";
$RCCAPTURE		= "$PREFIX/etc/rc.capture";
$RCLOCAL		= "/etc/rc.local";
$PHP_INI		= "/usr/local/etc/php.ini";
321
$PHP_CONF		= "/usr/local/etc/php.conf";
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
$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
339
$MYSQLD			= "/usr/local/libexec/mysqld";
340
341
342
343
344
345
$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";
346
$MYSQL_CNF		= "/usr/local/etc/mysql/my.cnf";
347
348
349
350
351
352
353
354
355

$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";
356
$HTTPD_GENI_CONF	= "$APACHE_ETCDIR/httpd-geni.conf";
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
$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";
380
$UPDATESITEVARS		= "$PREFIX/sbin/update_sitevars";
381
$IMAGEIMPORT            = "$PREFIX/sbin/image_import";
382
383
384
385
386

$PROTOUSER_KEY		= "$main::TOP_SRCDIR/install/elabman_dsa.pub";
$ROOT_PRIVKEY		= "/root/.ssh/id_rsa";
$ROOT_PUBKEY		= "$ROOT_PRIVKEY.pub";
$ROOT_AUTHKEY		= "/root/.ssh/authorized_keys";
387
388
$ROOT_DSA_PRIVKEY	= "/root/.ssh/id_dsa";
$ROOT_DSA_PUBKEY	= "$ROOT_DSA_PRIVKEY.pub";
389

390
391
$INIT_PRIVKEY		= "$main::TOP_SRCDIR/install/id_rsa";
$INIT_PUBKEY		= "$main::TOP_SRCDIR/install/id_rsa.pub";
392
393
394
395
396
397
398
399
400
401
402
$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 B Stoller's avatar
Leigh B Stoller committed
403
$IMAGEKEYS_DIR	        = "$ETCDIR/image_hostkeys";
404

Leigh B Stoller's avatar
Leigh B Stoller committed
405
$DEFAULTIMAGESITEVAR    = "general/default_imagename";
406
$IMAGEPASSWORDSITEVAR   = "images/root_password";
Leigh B Stoller's avatar
Leigh B Stoller committed
407

408
409
410
$MAILMANDIR		= "/usr/local/mailman";
$MAILMANCFG		= "$MAILMANDIR/Mailman/mm_cfg.py";

411
$SHAREDIR		= "@FSDIR_SHARE@";
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
$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";
}

441
442
443
444
445
446
# Firewall stuff
$FIREWALL_BOSS		= @FIREWALL_BOSS@;
$FIREWALL_OPS		= @FIREWALL_OPS@;
$FIREWALL_BOSS_RULES    = "/etc/boss.ipfw";
$FIREWALL_OPS_RULES     = "/etc/ops.ipfw";

447
448
449
450
451
452
453
454
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
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;