Commit 492e5bfa authored by Leigh Stoller's avatar Leigh Stoller

Testbed Master Control Daemon. Catchy name, eh? Note that tmcd runs

on paper. tmcc runs on the testbed nodes. The linux and freebsd directories
have the scripts and skeleton passwd/group file stuff. There are makefiles
in those directories for installing on the testbed node (typically before
you cut an image!).
parent 70175ba1
#
# Insert Copyright Here.
#
include ../Makeconf
include ../GNUmakerules
PROGRAMS = tmcd tmcc
all: $(PROGRAMS)
tmcd: tmcd.c
$(CC) $(CFLAGS) -g -o tmcd tmcd.c \
-I/usr/local/include \
$(LFLAGS) -L/usr/local/lib/mysql -lmysqlclient
tmcc: tmcc.c
$(CC) $(CFLAGS) -g -o tmcc tmcc.c $(LFLAGS)
tmcc.c: decls.h
tmcd.c: decls.h
install: all
install: $(INSTALL_BINDIR)/tmcd/tmcd \
$(INSTALL_BINDIR)/tmcd/tmcd.restart
$(INSTALL_BINDIR)/tmcd/%: %
@echo "Installing $<"
-mkdir -p $(INSTALL_BINDIR)/tmcd
$(INSTALL_PROGRAM) $< $@
clean:
rm -f *.o core $(PROGRAMS)
/*
* Insert Copyright Here.
*/
#define TBSERVER_PORT 7777
#
# XXX ONLY RUN THIS INSTALL ON A FREEBSD TESTBED NODE!
#
# Trivial. These things just need to be installed into the right place
# on a testbed node before cutting an image.
#
#
INSTALL_DIR = /etc/testbed
INSTALL_FILES = group master.passwd setup
INSTALL = /usr/bin/install -c
install:
-mkdir -p $(INSTALL_DIR)
$(INSTALL) -m 644 group $(INSTALL_DIR)/group
$(INSTALL) -m 600 master.passwd $(INSTALL_DIR)/master.passwd
$(INSTALL) -m 755 setup $(INSTALL_DIR)/setup
$(INSTALL) -m 755 ../tmcc $(INSTALL_DIR)/tmcc
# $FreeBSD: src/etc/group,v 1.19 1999/08/27 23:23:41 peter Exp $
#
wheel:*:0:root,mike,sclawson,lepreau,stoller,forys,kwright,danderse,newbold,calfeld
daemon:*:1:daemon
kmem:*:2:root
sys:*:3:root
tty:*:4:root
operator:*:5:root,mike
mail:*:6:
bin:*:7:
news:*:8:
man:*:9:
games:*:13:
staff:*:20:root,mike,stoller,lepreau
guest:*:31:root
bind:*:53:
uucp:*:66:
xten:*:67:xten
dialer:*:68:
network:*:69:
nogroup:*:65533:
nobody:*:65534:
root:kEi.I6fTKyJDg:0:0::0:0:Charlie &:/root:/bin/csh
toor:*:0:0::0:0:Bourne-again Superuser:/root:
daemon:*:1:1::0:0:Owner of many system processes:/root:/sbin/nologin
operator:*:2:5::0:0:System &:/:/sbin/nologin
bin:*:3:7::0:0:Binaries Commands and Source,,,:/:/sbin/nologin
tty:*:4:65533::0:0:Tty Sandbox:/:/sbin/nologin
kmem:*:5:65533::0:0:KMem Sandbox:/:/sbin/nologin
games:*:7:13::0:0:Games pseudo-user:/usr/games:/sbin/nologin
news:*:8:8::0:0:News Subsystem:/:/sbin/nologin
man:*:9:9::0:0:Mister Man Pages:/usr/share/man:/sbin/nologin
bind:*:53:53::0:0:Bind Sandbox:/:/sbin/nologin
uucp:*:66:66::0:0:UUCP pseudo-user:/var/spool/uucppublic:/usr/libexec/uucp/uucico
xten:*:67:67::0:0:X-10 daemon:/usr/local/xten:/sbin/nologin
pop:*:68:6::0:0:Post Office Owner:/nonexistent:/sbin/nologin
nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/sbin/nologin
lepreau:XzOQ6qRSyDp5A:12:10::0:0:Jay Lepreau:/users/lepreau:/bin/csh
mike:OQYay0WnwMYTs:27:10::0:0:Mike Hibler:/users/mike:/bin/csh
stoller:4.MMzSPURcOls:282:10::0:0:Leigh B. Stoller:/users/stoller:/bin/csh
tullmann:slG0cJEVIV7fk:3654:101::0:0:Patrick A Tullmann:/users/tullmann:/bin/tcsh
calfeld:amGW2iuQCjmyQ:2986:101::0:0:Chris Alfeld:/users/calfeld:/bin/tcsh
danderse:i7zCwgOeDkwZ6:2146:601::0:0:David G Andersen:/users/danderse:/bin/tcsh
kwright:LOBUwwa97jn36:1025:101::0:0:Kristin Wright:/users/kwright:/bin/tcsh
reid:i9vTbxvJp1Rpo:1296:101::0:0:Alastair Reid,,,:/users/reid:/bin/tcsh
newbold:b5CNBeTTiXYqA:2224:110::0:0:Mac G Newbold:/users/newbold:/bin/tcsh
axon:MAg80zUaZS52Q:2347:110::0:0:Logan Axon:/users/axon:/bin/tcsh
ricci:3MYM/vEONbd8k:1182:110::0:0:Robert Ricci:/users/ricci:/bin/tcsh
#!/usr/bin/perl -wT
use English;
#
# Initialize at boot time.
#
my $TMCC = "/etc/testbed/tmcc";
my $TMIFC = "/etc/testbed/rc.ifc";
my $TMDELAY = "/etc/testbed/rc.delay";
my $TMGROUP = "/etc/testbed/group";
my $TMPASSWD = "/etc/testbed/master.passwd";
my @CONFIGS = ($TMIFC, $TMDELAY);
my $REBOOTCMD = "reboot";
my $STATCMD = "status";
my $IFCCMD = "ifconfig";
my $ACCTCMD = "accounts";
my $DELAYCMD = "delay";
my $IFCONFIG = "/sbin/ifconfig fxp%d inet %s netmask %s\n";
my $CP = "/bin/cp -f";
my $MKDB = "/usr/sbin/pwd_mkdb -p";
my $PW = "/usr/sbin/pw";
my $CHPASS = "/usr/bin/chpass";
my $IFACE = "fxp";
my $CTLIFACE = "fxp4";
my $project = "";
my $PROJDIR = "/proj";
my $MOUNTCMD = "/sbin/mount 155.99.214.74:/q/proj/";
#
# This is a debugging thing for my home network.
#
my $NODE = "MYIP=155.99.214.136";
$NODE = "";
#
# Untaint path
#
$ENV{'PATH'} = '/bin:/sbin:/usr/bin:/usr/local/bin:/etc/testbed';
delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
#
# First clean up the node.
#
cleanup_node();
#
# Inform the master that we have rebooted.
#
open(TM, "$TMCC $NODE $REBOOTCMD |")
or die "Cannot start $TMCC: $!";
close(TM)
or die $? ? "$TMCC exited with status $?" : "Error closing pipe: $!";
#
# See if this node is allocated to an experiment.
#
print STDOUT "Checking Testbed reservation status ... \n";
open(TM, "$TMCC $NODE $STATCMD |")
or die "Cannot start $TMCC: $!";
$_ = <TM>;
close(TM)
or die $? ? "$TMCC exited with status $?" : "Error closing pipe: $!";
if ($_ =~ /^FREE/) {
print STDOUT " Free!\n";
exit(0);
}
if ($_ =~ /ALLOCATED=(\w*)\/(\w*)/) {
print STDOUT " Allocated: $1/$2!\n";
$project = $1;
}
else {
die("Error getting reservation status\n");
}
#
# Mount the project directory.
#
print STDOUT "Mounting the project directory on $PROJDIR/$project ... \n";
if (! mkdir("$PROJDIR/$project", 0770)) {
print STDERR "Could not make directory $PROJDIR/$project: $!\n";
}
if (system("$MOUNTCMD/$project $PROJDIR/$project") != 0) {
print STDERR "Could not mount project directory on $PROJDIR/$project.\n";
}
#
# Okay, lets find out about interfaces.
# Write a file of ifconfig lines, which will get executed.
#
print STDOUT "Checking Testbed interface configuration ... \n";
#
# Open a connection to the TMCD, and then open a local file into which
# we write ifconfig commands (as a shell script).
#
open(TM, "$TMCC $NODE $IFCCMD |")
or die "Cannot start $TMCC: $!";
open(IFC, ">$TMIFC")
or die("Could not open $TMIFC");
print IFC "#!/bin/sh\n";
while (<TM>) {
$_ =~ /INTERFACE=(\d*) INET=([0-9.]*) MASK=([0-9.]*)/;
printf STDOUT " $IFCONFIG", $1, $2, $3;
printf IFC $IFCONFIG, $1, $2, $3;
}
close(TM);
close(IFC);
chmod(0755, "$TMIFC");
#
# Delay node configuration
#
print STDOUT "Checking Testbed delay configuration ... \n";
my @delays;
open(TM, "$TMCC $NODE $DELAYCMD |")
or die "Cannot start $TMCC: $!";
while (<TM>) {
push(@delays, $_);
}
close(TM);
if (@delays) {
$count = 69;
# foreach $delay (@delays) {
# print $delay;
# }
open(DEL, ">$TMDELAY")
or die("Could not open $TMDELAY");
print DEL "#!/bin/sh\n";
print DEL "sysctl -w net.link.ether.bridge=0\n";
print DEL "sysctl -w net.link.ether.bridge_ipfw=0\n";
print DEL "sysctl -w net.link.ether.bridge_cfg=${CTLIFACE}:6,";
foreach $delay (@delays) {
$delay =~ /DELAY INT0=(\d) INT1=(\d) DELAY/;
print DEL "$IFACE$1:$count,$IFACE$2:$count,";
$count++;
}
print DEL "\n";
print DEL "sysctl -w net.link.ether.bridge=1\n";
print DEL "sysctl -w net.link.ether.bridge_ipfw=1\n";
print DEL "ipfw -f flush\n";
$count = 69;
$pipe = 100;
foreach $delay (@delays) {
$delay =~
/DELAY INT0=(\d) INT1=(\d) DELAY=(\d+) BW=([\d\.]+) PLR=([\d\.]+)/;
$iface1 = "$IFACE$1";
$iface2 = "$IFACE$2";
$p1 = $pipe += 10;
$p2 = $pipe += 10;
$delay = $3;
$bandw = $4;
$plr = $5;
print DEL "ipfw add pipe $p1 ip from any to any in recv $iface1\n";
print DEL "ipfw add pipe $p2 ip from any to any in recv $iface2\n";
print DEL "ipfw pipe $p1 config delay ${delay}ms bw ${bandw}Mbit/s ";
print DEL "plr $plr\n";
print DEL "ipfw pipe $p2 config delay ${delay}ms bw ${bandw}Mbit/s ";
print DEL "plr $plr\n";
print STDOUT " $iface1/$iface2 pipe $p1/$p2 config delay ";
print STDOUT "${delay}ms bw ${bandw}Mbit/s plr $plr\n";
$count++;
}
print DEL "echo \"Delay Configuration Complete\"\n";
close(DEL);
chmod(0755, "$TMDELAY");
}
#
# Account stuff. Again, open a connection to the TMCD, and receive
# ADDGROUP and ADDUSER commands. We turn those into "pw" commands.
#
print STDOUT "Checking Testbed group/user configuration ... \n";
open(TM, "$TMCC $NODE $ACCTCMD |")
or die "Cannot start $TMCC: $!";
while (<TM>) {
if ($_ =~ /^ADDGROUP NAME=([0-9a-zA-Z]+) GID=([0-9]+)/) {
print STDOUT " Group: $1/$2\n";
$group = $1;
$gid = $2;
($exists) = getgrgid($gid);
if ($exists) {
next;
}
if (system("$PW groupadd $group -g $gid") != 0) {
print STDERR "Error adding new group $1/$2: $!\n";
}
next;
}
if ($_ =~
/^ADDUSER LOGIN=([0-9a-z]+) PSWD=([^:]+) UID=(\d+) GID=(\d+) ROOT=(\d) NAME="(.*)"/)
{
$login = $1;
$pswd = $2;
$uid = $3;
$gid = $4;
$root = $5;
$name = $6;
if ( $name =~ /^(([^:]+$|^))$/ ) {
$name = $1;
}
print STDOUT " User: $login/$uid/$gid/$root/$name\n";
($exists) = getpwuid($uid);
if ($exists) {
next;
}
$GLIST = " ";
if ($root) {
$GLIST = "-G wheel ";
}
if (system("$PW useradd $login -u $uid -g $gid $GLIST ".
"-d /users/$login -s /bin/tcsh -c \"$name\"") != 0) {
print STDERR "Error adding new user $login\n";
next;
}
if (system("$CHPASS -p $pswd $login") != 0) {
print STDERR "Error changing password for user $login\n";
}
next;
}
}
close(TM);
#
# If node is free, reset to a moderately clean state.
#
sub cleanup_node () {
print STDOUT "Cleaning node; removing configuration files ...\n";
unlink @CONFIGS;
printf STDOUT "Resetting passwd and group files\n";
if (system("$CP -f $TMGROUP /etc/group") != 0) {
print STDERR "Could not copy default group file into place: $!\n";
exit(1);
}
if (system("$CP -f $TMPASSWD /etc/master.passwd_testbed") != 0) {
print STDERR "Could not copy default passwd file into place: $!\n";
exit(1);
}
if (system("$MKDB /etc/master.passwd_testbed") != 0) {
print STDERR "Failure running pwd_mkdb on default password file: $!\n";
exit(1);
}
}
#
# XXX ONLY RUN THIS INSTALL ON A LINUX TESTBED NODE!
#
# Trivial. These things just need to be installed into the right place
# on a testbed node before cutting an image.
#
#
INSTALL_DIR = /etc/rc.d/testbed
INSTALL_FILES = group gshadow passwd rc.testbed setup shadow
INSTALL = /usr/bin/install -c
install:
-mkdir -p $(INSTALL_DIR)
$(INSTALL) -m 644 group $(INSTALL_DIR)/group
$(INSTALL) -m 644 passwd $(INSTALL_DIR)/passwd
$(INSTALL) -m 600 shadow $(INSTALL_DIR)/shadow
$(INSTALL) -m 600 gshadow $(INSTALL_DIR)/gshadow
$(INSTALL) -m 755 rc.testbed $(INSTALL_DIR)/rc.testbed
$(INSTALL) -m 755 setup $(INSTALL_DIR)/setup
$(INSTALL) -m 755 ../tmcc $(INSTALL_DIR)/tmcc
root:x:0:root,stoller,newbold,calfeld,danderse,mike,reid,ricci,lepreau,kwright
bin:x:1:root,bin,daemon
daemon:x:2:root,bin,daemon
sys:x:3:root,bin,adm
adm:x:4:root,adm,daemon
tty:x:5:
disk:x:6:root
lp:x:7:daemon,lp
mem:x:8:
kmem:x:9:
wheel:x:10:root
mail:x:12:mail
news:x:13:news
uucp:x:14:uucp
man:x:15:
games:x:20:
gopher:x:30:
dip:x:40:
ftp:x:50:
nobody:x:99:
users:x:100:
floppy:x:19:
console:x:31:
utmp:x:22:
pppusers:x:44:
popusers:x:45:
slipusers:x:46:
xfs:x:43:
abone:x:500:
testbed:x:601:
root:::root,stoller,newbold,calfeld,danderse,mike,reid,ricci,lepreau,kwright
bin:::root,bin,daemon
daemon:::root,bin,daemon
sys:::root,bin,adm
adm:::root,adm,daemon
tty:::
disk:::root
lp:::daemon,lp
mem:::
kmem:::
wheel:::root
mail:::mail
news:::news
uucp:::uucp
man:::
games:::
gopher:::
dip:::
ftp:::
nobody:::
users:::
floppy:x::
console:x::
utmp:x::
pppusers:x::
popusers:x::
slipusers:x::
calfeld:!::
xfs:!::
testbed:!::
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:
daemon:x:2:2:daemon:/sbin:
adm:x:3:4:adm:/var/adm:
lp:x:4:7:lp:/var/spool/lpd:
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
mail:x:8:12:mail:/var/spool/mail:
news:x:9:13:news:/var/spool/news:
uucp:x:10:14:uucp:/var/spool/uucp:
operator:x:11:0:operator:/root:
gopher:x:13:30:gopher:/usr/lib/gopher-data:
ftp:x:14:50:FTP User:/home/ftp:
nobody:x:99:99:Nobody:/:
xfs:x:43:43:X Font Server:/etc/X11/fs:/bin/false
stoller:x:282:601::/users/stoller:/bin/tcsh
abocc:x:500:500:Abone administration:/local/abocc:/bin/bash
anee1:x:501:500:Abone EE Account:/local/anee1:/bin/bash
anee2:x:502:500:Abone EE Account:/local/anee2:/bin/bash
anee3:x:503:500:Abone EE Account:/local/anee3:/bin/bash
anee4:x:504:500:Abone EE Account:/local/anee4:/bin/bash
anee5:x:505:500:Abone EE Account:/local/anee5:/bin/bash
anpub:x:506:500:Abone EE Account:/local/anpub:/bin/bash
newbold:x:2224:601:Mac Newbold:/users/newbold:/bin/tcsh
calfeld:x:2986:601:Chris Alfeld:/users/calfeld:/bin/tcsh
axon:x:2347:601:Logan Axon:/users/axon:/bin/tcsh
danderse:x:2146:601:David G Andersen:/users/danderse:/bin/tcsh
mike:x:27:601:Mike Hibler:/users/mike:/bin/tcsh
reid:x:1296:601:Alastair Reid:/users/reid:/bin/tcsh
ricci:x:1182:601:Robert P Ricci:/users/ricci:/bin/tcsh
lepreau:x:12:601:Jay Lepreau:/users/lepreau:/bin/tcsh
kwright:x:1025:601:Kristin Wright:/users/kwright:/bin/tcsh
#!/bin/sh
if [ -x /etc/rc.d/testbed/setup ]; then
echo "Setting up Testbed Configuration"
/etc/rc.d/testbed/setup
fi
if [ -x /etc/rc.d/testbed/rc.ifc ]; then
echo "Setting up Testbed Interfaces"
/etc/rc.d/testbed/rc.ifc
fi
#!/usr/bin/perl -wT
use English;
#
# Initialize at boot time.
#
my $TMCC = "/etc/rc.d/testbed/tmcc";
my $TMIFC = "/etc/rc.d/testbed/rc.ifc";
my $TMGROUP = "/etc/rc.d/testbed/group";
my $TMPASSWD = "/etc/rc.d/testbed/passwd";
my $TMSHADOW = "/etc/rc.d/testbed/shadow";
my $TMGSHADOW = "/etc/rc.d/testbed/gshadow";
my @CONFIGS = ($TMIFC);
my $REBOOTCMD = "reboot";
my $STATCMD = "status";
my $IFCCMD = "ifconfig";
my $ACCTCMD = "accounts";
my $DELAYCMD = "delay";
my $IFCONFIG = "/sbin/ifconfig eth%d inet %s netmask %s\n";
my $CP = "/bin/cp -f";
my $USERADD = "/usr/sbin/useradd";
my $GROUPADD = "/usr/sbin/groupadd";
my $IFACE = "eth";
my $CTLIFACE = "eth4";
my $project = "";
my $PROJDIR = "/proj";
my $MOUNTCMD = "/bin/mount 155.99.214.74:/q/proj/";
#
# This is a debugging thing for my home network.
#
my $NODE = "MYIP=155.99.214.136";
$NODE = "";
#
# Untaint path
#
$ENV{'PATH'} = '/bin:/sbin:/usr/bin:/usr/local/bin:/etc/rc.d/testbed';
delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
#
# First clean up the node.
#
cleanup_node();
#
# Inform the master that we have rebooted.
#
open(TM, "$TMCC $NODE $REBOOTCMD |")
or die "Cannot start $TMCC: $!";
close(TM)
or die $? ? "$TMCC exited with status $?" : "Error closing pipe: $!";
#
# See if this node is allocated to an experiment.
#
print STDOUT "Checking Testbed reservation status ... \n";
open(TM, "$TMCC $NODE $STATCMD |")
or die "Cannot start $TMCC: $!";
$_ = <TM>;
close(TM)
or die $? ? "$TMCC exited with status $?" : "Error closing pipe: $!";
if ($_ =~ /^FREE/) {
print STDOUT " Free!\n";
exit(0);
}
if ($_ =~ /ALLOCATED=(\w*)\/(\w*)/) {
print STDOUT " Allocated: $1/$2!\n";
$project = $1;
}
else {
die("Error getting reservation status\n");
}
#
# Mount the project directory.
#
print STDOUT "Mounting the project directory on $PROJDIR/$project ... \n";
if (! mkdir("$PROJDIR/$project", 0770)) {
print STDERR "Could not make directory $PROJDIR/$project: $!\n";
}
if (system("$MOUNTCMD/$project $PROJDIR/$project") != 0) {
print STDERR "Could not mount project directory on $PROJDIR/$project.\n";
}
#
# Okay, lets find out about interfaces.
# Write a file of ifconfig lines, which will get executed.
#
print STDOUT "Checking Testbed interface configuration ... \n";
#
# Open a connection to the TMCD, and then open a local file into which
# we write ifconfig commands (as a shell script).
#
open(TM, "$TMCC $NODE $IFCCMD |")
or die "Cannot start $TMCC: $!";
open(IFC, ">$TMIFC")
or die("Could not open $TMIFC");
print IFC "#!/bin/sh\n";
while (<TM>) {
$_ =~ /INTERFACE=(\d*) INET=([0-9.]*) MASK=([0-9.]*)/;
printf STDOUT " $IFCONFIG", $1, $2, $3;
printf IFC $IFCONFIG, $1, $2, $3;
}
close(TM);
close(IFC);
chmod(0755, "$TMIFC");
#
# Account stuff. Again, open a connection to the TMCD, and receive
# ADDGROUP and ADDUSER commands. We turn those into "pw" commands.
#
print STDOUT "Checking Testbed group/user configuration ... \n";
open(TM, "$TMCC $NODE $ACCTCMD |")
or die "Cannot start $TMCC: $!";
while (<TM>) {
if ($_ =~ /^ADDGROUP NAME=([0-9a-zA-Z]+) GID=([0-9]+)/) {
print STDOUT " Group: $1/$2\n";
$group = $1;
$gid = $2;
($exists) = getgrgid($gid);
if ($exists) {
next;
}
if (system("$GROUPADD -g $gid $group") != 0) {
print STDERR "Error adding new group $1/$2: $!\n";
}
next;
}
if ($_ =~
/^ADDUSER LOGIN=([0-9a-z]+) PSWD=([^:]+) UID=(\d+) GID=(\d+) ROOT=(\d) NAME="(.*)"/)
{
$login = $1;
$pswd = $2;
$uid = $3;
$gid = $4;
$root = $5;
$name = $6;
if ( $name =~ /^(([^:]+$|^))$/ ) {
$name = $1;
}
print STDOUT " User: $login/$uid/$gid/$root/$name\n";
($exists) = getpwuid($uid);
if ($exists) {
next;
}
$GLIST = " ";
if ($root) {
$GLIST = "-G root ";
}
if (system("$USERADD -u $uid -g $gid -p $pswd $GLIST ".
"-d /users/$login -s /bin/tcsh -c \"$name\" $login") != 0) {
print STDERR "Error adding new user $login\n";
next;
}
next;
}
}
close(TM);
#
# If node is free, reset to a moderately clean state.
#
sub cleanup_node () {
print STDOUT "Cleaning node; removing configuration files ...\n";
unlink @CONFIGS;
printf STDOUT "Resetting passwd and group files\n";
if (system("$CP -f $TMGROUP $TMPASSWD /etc") != 0) {
print STDERR "Could not copy default group file into place: $!\n";
exit(1);
}
if (system("$CP -f $TMSHADOW $TMGSHADOW /etc") != 0) {
print STDERR "Could not copy default passwd file into place: $!\n";
exit(1);
}
}
root:$1$eCRCRYMz$9NpsdLSc.5/DYOfmlktI4/:11152:0:99999:7:-1:-1:134540356
bin:*:11152:0:99999:7:::
daemon:*:11152:0:99999:7:::
adm:*:11152:0:99999:7:::
lp:*:11152:0:99999:7:::
sync:*:11152:0:99999:7:::
shutdown:*:11152:0:99999:7:::
halt:*:11152:0:99999:7:::
mail:*:11152:0:99999:7:::
news:*:11152:0:99999:7:::
uucp:*:11152:0:99999:7:::
operator:*:11152:0:99999:7:::
gopher:*:11152:0:99999:7:::
ftp:*:11152:0:99999:7:::
nobody:*:11152:0:99999:7:::
xfs:!!:11169:0:99999:7:::
stoller:$1$GflppnwT$C0ye6tL1kjCJw1n4MsVI1/:11311:0:99999:7:-1:-1:134540332
abocc:!!:11311:0:99999:7:::
anee1:!!:11311:0:99999:7:::
anee2:!!:11311:0:99999:7:::
anee3:!!:11311:0:99999:7:::
anee4:!!:11311:0:99999:7:::
anee5:!!:11311:0:99999:7:::
anpub:!!:11311:0:99999:7:::
newbold:b5CNBeTTiXYqA:11311:0:99999:7:::
calfeld:amGW2iuQCjmyQ:11311:0:99999:7:::
axon:MAg80zUaZS52Q:11311:0:99999:7:::
danderse:i7zCwgOeDkwZ6:11311:0:99999:7:::
mike:OQYay0WnwMYTs:11311:0:99999:7:::
reid:i9vTbxvJp1Rpo:11311:0:99999:7:::
ricci:3MYM/vEONbd8k:11311:0:99999:7:::
lepreau:XzOQ6qRSyDp5A:11311:0:99999:7:::
kwright:LOBUwwa97jn36:11311:0:99999:7:::
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <stdio.h>
#include <errno.h>
#include <syslog.h>
#include <unistd.h>
#include <signal.h>
#include <stdarg.h>
#include <sys/time.h>
#include <time.h>
#include <assert.h>
#include "decls.h"
#ifdef LBS
#define MASTERNODE "206.163.153.25"
#else
#define MASTERNODE "155.99.212.70"
#endif
void sigcatcher(int foo);
main(int argc, char **argv)
{
int sock, length, data, n, cc, err, i;
struct sockaddr_in name, client;
struct timeval tv;