version 1.11, 2000/12/23 16:56:46
|
version 1.15, 2001/01/10 18:47:35
|
Line 45 ENDERROUT
|
Line 45 ENDERROUT
|
|
|
# ================================================================ Main Program |
# ================================================================ Main Program |
|
|
|
|
# ------------------------------------------------------------ Read access.conf |
# ------------------------------------------------------------ Read access.conf |
{ |
{ |
my $config=IO::File->new("/etc/httpd/conf/access.conf"); |
my $config=IO::File->new("/etc/httpd/conf/access.conf"); |
Line 58 ENDERROUT
|
Line 57 ENDERROUT
|
} |
} |
} |
} |
|
|
|
# --------------------------------------- Make sure that LON-CAPA is configured |
|
# I only test for one thing here (lonHostID). This is just a safeguard. |
|
if ('{[[[[lonHostID]]]]}' eq $perlvar{'lonHostID'}) { |
|
print("Unconfigured machine.\n"); |
|
$emailto=$perlvar{'lonSysEMail'}; |
|
$hostname=`/bin/hostname`; |
|
chop $hostname; |
|
$hostname=~s/[^\w\.]//g; # make sure is safe to pass through shell |
|
$subj="LON: Unconfigured machine $hostname"; |
|
system("echo 'Unconfigured machine $hostname.' |\ |
|
mailto $emailto -s '$subj' > /dev/null"); |
|
exit 1; |
|
} |
|
|
|
# ----------------------------- Make sure this process is running from user=www |
|
my $wwwid=getpwnam('www'); |
|
if ($wwwid!=$<) { |
|
print("User ID mismatch. This program must be run as user 'www'\n"); |
|
$emailto="$perlvar{'lonAdmEMail'},$perlvar{'lonSysEMail'}"; |
|
$subj="LON: $perlvar{'lonHostID'} User ID mismatch"; |
|
system("echo 'User ID mismatch. loncron must be run as user www.' |\ |
|
mailto $emailto -s '$subj' > /dev/null"); |
|
exit 1; |
|
} |
|
|
# ------------------------------------------------------------- Read hosts file |
# ------------------------------------------------------------- Read hosts file |
{ |
{ |
my $config=IO::File->new("$perlvar{'lonTabDir'}/hosts.tab"); |
my $config=IO::File->new("$perlvar{'lonTabDir'}/hosts.tab"); |