--- loncom/loncron 2001/01/10 17:20:44 1.12 +++ loncom/loncron 2001/01/10 17:39:36 1.13 @@ -45,13 +45,6 @@ ENDERROUT # ================================================================ Main Program -# ----------------------------- 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") unless $noprint; - exit 1; -} - # ------------------------------------------------------------ Read access.conf { my $config=IO::File->new("/etc/httpd/conf/access.conf"); @@ -64,6 +57,17 @@ if ($wwwid!=$<) { } } +# ----------------------------- 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") unless $noprint; + $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 { my $config=IO::File->new("$perlvar{'lonTabDir'}/hosts.tab");