version 1.13, 2001/01/10 17:39:36
|
version 1.14, 2001/01/10 17:49:56
|
Line 57 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("User ID mismatch. This program must be run as user 'www'\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 |
# ----------------------------- Make sure this process is running from user=www |
my $wwwid=getpwnam('www'); |
my $wwwid=getpwnam('www'); |
if ($wwwid!=$<) { |
if ($wwwid!=$<) { |
print("User ID mismatch. This program must be run as user 'www'\n") unless $noprint; |
print("User ID mismatch. This program must be run as user 'www'\n"); |
$emailto="$perlvar{'lonAdmEMail'},$perlvar{'lonSysEMail'}"; |
$emailto="$perlvar{'lonAdmEMail'},$perlvar{'lonSysEMail'}"; |
$subj="LON: $perlvar{'lonHostID'} User ID mismatch"; |
$subj="LON: $perlvar{'lonHostID'} User ID mismatch"; |
system("echo 'User ID mismatch. loncron must be run as user www.' |\ |
system("echo 'User ID mismatch. loncron must be run as user www.' |\ |
mailto $emailto -s '$subj' > /dev/null"); |
mailto $emailto -s '$subj' > /dev/null"); |
exit 1; |
exit 1; |
} |
} |
|
|
# ------------------------------------------------------------- Read hosts file |
# ------------------------------------------------------------- Read hosts file |