version 1.467.2.3, 2011/05/14 17:14:29
|
version 1.476, 2011/07/28 15:12:03
|
Line 15
|
Line 15
|
# |
# |
# LON-CAPA is distributed in the hope that it will be useful, |
# LON-CAPA is distributed in the hope that it will be useful, |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
# GNU General Public License for more details. |
# GNU General Public License for more details. |
# |
# |
Line 600 sub InstallFile {
|
Line 601 sub InstallFile {
|
# |
# |
# ConfigFileFromSelector: converts a configuration file selector |
# ConfigFileFromSelector: converts a configuration file selector |
# into a configuration file pathname. |
# into a configuration file pathname. |
# Supports the following file selectors: |
# Supports the following file selectors: |
# hosts, domain, dns_hosts, dns_domain |
# hosts, domain, dns_hosts, dns_domain |
# |
# |
# |
# |
# Parameters: |
# Parameters: |
Line 614 sub ConfigFileFromSelector {
|
Line 615 sub ConfigFileFromSelector {
|
my $tablefile; |
my $tablefile; |
|
|
my $tabledir = $perlvar{'lonTabDir'}.'/'; |
my $tabledir = $perlvar{'lonTabDir'}.'/'; |
if (($selector eq "hosts") || ($selector eq "domain") || |
if (($selector eq "hosts") || ($selector eq "domain") || |
($selector eq "dns_hosts") || ($selector eq "dns_domain")) { |
($selector eq "dns_hosts") || ($selector eq "dns_domain")) { |
$tablefile = $tabledir.$selector.'.tab'; |
$tablefile = $tabledir.$selector.'.tab'; |
} |
} |
return $tablefile; |
return $tablefile; |
|
|
} |
} |
# |
# |
# PushFile: Called to do an administrative push of a file. |
# PushFile: Called to do an administrative push of a file. |
Line 646 sub PushFile {
|
Line 646 sub PushFile {
|
# hosts.tab ($filename eq host). |
# hosts.tab ($filename eq host). |
# domain.tab ($filename eq domain). |
# domain.tab ($filename eq domain). |
# dns_hosts.tab ($filename eq dns_host). |
# dns_hosts.tab ($filename eq dns_host). |
# dns_domain.tab ($filename eq dns_domain). |
# dns_domain.tab ($filename eq dns_domain). |
# Construct the destination filename or reject the request. |
# Construct the destination filename or reject the request. |
# |
# |
# lonManage is supposed to ensure this, however this session could be |
# lonManage is supposed to ensure this, however this session could be |
Line 677 sub PushFile {
|
Line 677 sub PushFile {
|
.$tablefile." $! </font>"); |
.$tablefile." $! </font>"); |
return "error:$!"; |
return "error:$!"; |
} else { |
} else { |
&logthis('<font color="green"> Installed new '.$tablefile |
&logthis('<font color="green"> Installed new '.$tablefile |
." - transaction by: $clientname ($clientip)</font>"); |
." - transaction by: $clientname ($clientip)</font>"); |
my $adminmail = $perlvar{'lonAdmEMail'}; |
my $adminmail = $perlvar{'lonAdmEMail'}; |
my $admindom = &Apache::lonnet::host_domain($perlvar{'lonHostID'}); |
my $admindom = &Apache::lonnet::host_domain($perlvar{'lonHostID'}); |
if ($admindom ne '') { |
if ($admindom ne '') { |
Line 2278 sub fetch_user_file_handler {
|
Line 2278 sub fetch_user_file_handler {
|
|
|
my $destname=$udir.'/'.$ufile; |
my $destname=$udir.'/'.$ufile; |
my $transname=$udir.'/'.$ufile.'.in.transit'; |
my $transname=$udir.'/'.$ufile.'.in.transit'; |
my $remoteurl='http://'.$clientip.'/userfiles/'.$fname; |
my $clientprotocol=$Apache::lonnet::protocol{$clientname}; |
|
$clientprotocol = 'http' if ($clientprotocol ne 'https'); |
|
my $remoteurl=$clientprotocol.'://'.$clientip.'/userfiles/'.$fname; |
my $response; |
my $response; |
Debug("Remote URL : $remoteurl Transfername $transname Destname: $destname"); |
Debug("Remote URL : $remoteurl Transfername $transname Destname: $destname"); |
alarm(120); |
alarm(120); |
Line 5038 sub validate_course_owner_handler {
|
Line 5040 sub validate_course_owner_handler {
|
my ($cmd, $tail, $client) = @_; |
my ($cmd, $tail, $client) = @_; |
my $userinput = "$cmd:$tail"; |
my $userinput = "$cmd:$tail"; |
my ($inst_course_id, $owner, $cdom, $coowners) = split(/:/, $tail); |
my ($inst_course_id, $owner, $cdom, $coowners) = split(/:/, $tail); |
|
|
$owner = &unescape($owner); |
$owner = &unescape($owner); |
$coowners = &unescape($coowners); |
$coowners = &unescape($coowners); |
my $outcome = &localenroll::new_course($inst_course_id,$owner,$cdom,$coowners); |
my $outcome = &localenroll::new_course($inst_course_id,$owner,$cdom,$coowners); |
Line 6029 if (-e $pidfile) {
|
Line 6031 if (-e $pidfile) {
|
$server = IO::Socket::INET->new(LocalPort => $perlvar{'londPort'}, |
$server = IO::Socket::INET->new(LocalPort => $perlvar{'londPort'}, |
Type => SOCK_STREAM, |
Type => SOCK_STREAM, |
Proto => 'tcp', |
Proto => 'tcp', |
ReuseAddr => 1, |
ReuseAddr => 1, |
Listen => 10 ) |
Listen => 10 ) |
or die "making socket: $@\n"; |
or die "making socket: $@\n"; |
|
|
Line 6092 sub HUPSMAN { # sig
|
Line 6094 sub HUPSMAN { # sig
|
# a setuid perl script that can be root for us to do this job. |
# a setuid perl script that can be root for us to do this job. |
# |
# |
sub ReloadApache { |
sub ReloadApache { |
|
# --------------------------- Handle case of another apachereload process (locking) |
if (&LONCAPA::try_to_lock('/tmp/lock_apachereload')) { |
if (&LONCAPA::try_to_lock('/tmp/lock_apachereload')) { |
my $execdir = $perlvar{'lonDaemons'}; |
my $execdir = $perlvar{'lonDaemons'}; |
my $script = $execdir."/apachereload"; |
my $script = $execdir."/apachereload"; |
Line 6364 my %iphost = &Apache::lonnet::get_iphost
|
Line 6367 my %iphost = &Apache::lonnet::get_iphost
|
my $dist=`$perlvar{'lonDaemons'}/distprobe`; |
my $dist=`$perlvar{'lonDaemons'}/distprobe`; |
|
|
my $arch = `uname -i`; |
my $arch = `uname -i`; |
|
chomp($arch); |
if ($arch eq 'unknown') { |
if ($arch eq 'unknown') { |
$arch = `uname -m`; |
$arch = `uname -m`; |
|
chomp($arch); |
} |
} |
|
|
# -------------------------------------------------------------- |
# -------------------------------------------------------------- |
Line 6434 sub make_new_child {
|
Line 6439 sub make_new_child {
|
#don't get intercepted |
#don't get intercepted |
$SIG{USR1}= \&logstatus; |
$SIG{USR1}= \&logstatus; |
$SIG{ALRM}= \&timeout; |
$SIG{ALRM}= \&timeout; |
|
# |
# |
# Block sigpipe as it gets thrownon socket disconnect and we want to |
# Block sigpipe as it gets thrownon socket disconnect and we want to |
# deal with that as a read faiure instead. |
# deal with that as a read faiure instead. |
# |
# |
my $blockset = POSIX::SigSet->new(SIGPIPE); |
my $blockset = POSIX::SigSet->new(SIGPIPE); |
sigprocmask(SIG_BLOCK, $blockset); |
sigprocmask(SIG_BLOCK, $blockset); |
|
|
|
$lastlog='Forked '; |
$lastlog='Forked '; |
$status='Forked'; |
$status='Forked'; |
Line 7165 sub subscribe {
|
Line 7169 sub subscribe {
|
# the metadata |
# the metadata |
unless ($fname=~/\.meta$/) { &unsub("$fname.meta",$clientip); } |
unless ($fname=~/\.meta$/) { &unsub("$fname.meta",$clientip); } |
$fname=~s/\/home\/httpd\/html\/res/raw/; |
$fname=~s/\/home\/httpd\/html\/res/raw/; |
$fname="http://".&Apache::lonnet::hostname($perlvar{'lonHostID'})."/".$fname; |
my $protocol = $Apache::lonnet::protocol{$perlvar{'lonHostID'}}; |
|
$protocol = 'http' if ($protocol ne 'https'); |
|
$fname=$protocol.'://'.&Apache::lonnet::hostname($perlvar{'lonHostID'})."/".$fname; |
$result="$fname\n"; |
$result="$fname\n"; |
} |
} |
} else { |
} else { |