4
#*********************************************************************
6
# faimond -- monitor daemon which collects client status info
8
# This script is part of FAI (Fully Automatic Installation)
9
# (c) 2003-2004 by Thomas Lange, lange@informatik.uni-koeln.de
10
# Universitaet zu Koeln
12
#*********************************************************************
20
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
23
my $proto = getprotobyname('tcp');
24
socket(SERVER, PF_INET, SOCK_STREAM, $proto) or die "socket: $!";
25
setsockopt(SERVER, SOL_SOCKET, SO_REUSEADDR, 1) or die "setsock: $!";
27
my $paddr = sockaddr_in($port, INADDR_ANY);
29
bind(SERVER, $paddr) or die "bind: $!";
30
listen(SERVER, SOMAXCONN) or die "listen: $!";
31
print "FAI monitoring daemon started on port $port\n";
33
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
36
# accept a connection, print message received and close
37
my ($client_addr,$inp);
38
while ($client_addr = accept(CLIENT, SERVER)) {
44
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -