version 1.35, 2007/11/09 18:51:10
|
version 1.40, 2009/04/17 00:12:14
|
Line 134 sub catchexception {
|
Line 134 sub catchexception {
|
|
|
sub child_announce_death { |
sub child_announce_death { |
$SIG{USR1} = \&child_announce_death; |
$SIG{USR1} = \&child_announce_death; |
$extra_children++; |
if ($extra_children < $PREFORK*10) { |
|
$extra_children++; |
|
} |
} |
} |
|
|
# ---------------------------------------------------------------- Main program |
# ---------------------------------------------------------------- Main program |
Line 268 sub make_new_child {
|
Line 270 sub make_new_child {
|
|
|
$command->log_stdout(0); |
$command->log_stdout(0); |
#$command->log_file("$execdir/logs/lonmaxima.session.log"); |
#$command->log_file("$execdir/logs/lonmaxima.session.log"); |
&sync($command); |
|
|
|
for (my $i=0; $i < $MAX_CLIENTS_PER_CHILD; $i++) { |
for (my $i=0; $i < $MAX_CLIENTS_PER_CHILD; $i++) { |
&status('Accepting connections'); |
&status('Accepting connections'); |
my $client = $server->accept() or last; |
my $client = $server->accept() or last; |
print $command ("display2d:false;kill(all);\n"); |
&sync($command); |
|
print $command ("display2d:false;simp:true;kill(all);\n"); |
&getmaximaoutput($command,2); |
&getmaximaoutput($command,2); |
&sync($command); |
&sync($command); |
my $syntaxerr = 0; |
my $syntaxerr = 0; |
Line 299 sub make_new_child {
|
Line 301 sub make_new_child {
|
kill('USR1' => $ppid); |
kill('USR1' => $ppid); |
print $command ("quit();\n"); |
print $command ("quit();\n"); |
# tidy up gracefully and finish |
# tidy up gracefully and finish |
|
sleep(15); |
$command->soft_close(); |
$command->soft_close(); |
|
|
# this exit is VERY important, otherwise the child will become |
# this exit is VERY important, otherwise the child will become |
Line 354 sub getmaximaoutput {
|
Line 356 sub getmaximaoutput {
|
if ($error) { |
if ($error) { |
return 'Error: '.$error; |
return 'Error: '.$error; |
} |
} |
$output =~ s/\r+//g; # Remove Windows-style linebreaks |
$output =~ s/\r+//gs; # Remove Windows-style linebreaks |
my $foundoutput=0; |
my $foundoutput=0; |
my $found_label=0; |
my $found_label=0; |
my $realoutput=''; |
my $realoutput=''; |