Changeset 16218 for misc/runpugs
- Timestamp:
- 05/07/07 16:26:38 (19 months ago)
- Location:
- misc/runpugs
- Files:
-
- 4 added
- 6 modified
-
bin/multi_client_model.pl (modified) (4 diffs)
-
bin/perl_repl.pl (added)
-
bin/termdispatcher.pl (modified) (1 diff)
-
bin/termserv.pl (modified) (1 diff)
-
bin/test_session.pl (added)
-
bin/test_session_dispatcher.pl (added)
-
lib/Repl.pm (added)
-
lib/Web/Terminal/Server.pm (modified) (7 diffs)
-
lib/Web/Terminal/Server/Session.pm (modified) (14 diffs)
-
lib/Web/Terminal/Settings.pm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
misc/runpugs/bin/multi_client_model.pl
r15833 r16218 6 6 use strict; 7 7 8 use threads; # pull in threading routines8 #use threads; # pull in threading routines 9 9 10 10 use lib '../lib/'; … … 19 19 our $nclients_serial=500; 20 20 21 #for my $i (0..$n_threads-1) { 22 # $threads[$i]=threads->create("client_session",$i); 23 #} 24 25 # program exits when first thread exits 26 my $pid; 21 27 for my $i (0..$n_threads-1) { 22 $threads[$i]=threads->create("client_session",$i); 23 } 24 25 # program exits when first thread exits 26 $threads[0]->join(); 28 if($pid=fork()) { 29 print "Spawned $i\n"; 30 } elsif (defined $pid) { # Child 31 print "Running $i\n"; 32 &client_session($i); 33 exit(0); 34 } else { 35 die "Fork failed!"; 36 } 37 } 38 print "Parent: done creating clients."; 39 sleep 3600; 40 #$threads[0]->join(); 27 41 28 42 … … 108 122 print "$i:WARNING2: $cmd<>$reply\n";# if $v; 109 123 #if ($reply eq '0') { 110 system("./killall_perl"); 124 #system("./killall_perl"); 125 kill 9,getppid(); 111 126 exit() ; 112 127 #} … … 118 133 } elsif ($abort) { 119 134 &send_cmd(':A',$id,$ip,$app); 120 } #� therwise do nothing, server should time the session out135 } #�otherwise do nothing, server should time the session out 121 136 my $w_log= rand($w_max_log)+$w_min_log; 122 137 my $wait=int(2**$w_log); 123 138 print "\n$i:Waiting for $wait seconds...\n" if $v; 124 139 sleep $wait; 125 } #� nd of nclients_serial loop140 } #�end of nclients_serial loop 126 141 127 142 } -
misc/runpugs/bin/termdispatcher.pl
r14512 r16218 6 6 # 7 7 use lib '../lib/'; 8 use WebTerminal::Dispatcher; 8 use Web::Terminal::Settings; 9 use Web::Terminal::Dispatcher; 10 #$Web::Terminal::Settings::port=2058; 9 11 10 12 11 13 my $id=$ARGV[0]||-1; 12 my $cmd=$ARGV[1] || 'my $a='.$id.';say "Hello, $a";'; 13 #my $cmd='my $a='.$id.';say "Hello, $a";'; 14 my $prompt='pugs> '; 14 my $cmd=$ARGV[1] || 'print "hello\n";say "there";print 4'; 15 15 print "Sending msg $id: $cmd\n"; 16 16 my $ip="127.0.0.1"; 17 my $dev=1; 18 my $reply = &WebTerminal::Dispatcher::send($id,$ip,$dev,$prompt.$cmd);17 (my $reply,my $prompt,my $histref) = 18 &Web::Terminal::Dispatcher::send($id,$ip,1,1,$cmd); 19 19 print $reply; 20 print "\nHistory\n"; 21 for my $entry (@{$histref}) { 22 print "\t$entry\n"; 23 } 20 24 -
misc/runpugs/bin/termserv.pl
r14233 r16218 1 1 #!/usr/bin/perl 2 use strict; 3 use warnings; 4 #BEGIN { 5 #$ENV{PERLIO}= ":utf8"; 6 #} 7 #use utf8; 8 2 9 use warnings; 3 10 use strict; 4 use utf8; 11 5 12 use lib '../lib/'; 6 use Web Terminal::Server;7 my $host = 'localhost';8 my $port = 2057;13 use Web::Terminal::Server; 14 use Web::Terminal::Settings; 15 $Web::Terminal::Settings::port=2059; 9 16 $ENV{PUGS_SAFEMODE}=1; 10 &WebTerminal::Server::run($host,$port); 17 my $v=1-$Web::Terminal::Settings::daemon; 18 print "Starting server\n" if $v; 19 &Web::Terminal::Server::run(); 11 20 -
misc/runpugs/lib/Web/Terminal/Server.pm
r16056 r16218 458 458 sub create_session { 459 459 my $app = shift; 460 my $session_number=-3;460 my $session_number=-3; 461 461 if ( $n_sessions[$app] < $n_max[$app] ) { 462 462 # Yes, there is room to create a new session … … 476 476 } else { 477 477 # Something went wrong, failed to create a new session 478 print "Something went wrong, failed to create a new session:\n"; 479 print $new_session->{'error'}; 480 print $new_session->{'output'}; 481 478 482 # push session number back onto stack 479 483 push @{ $session_numbers_stack[$app] }, $session_number; … … 484 488 $session_number= -2; # max nsessions reached 485 489 } 486 print " +++ Created session$session_number ($app): tot:$n_sessions[$app]; active: $n_active_sessions[$app];inactive: $n_inactive_sessions[$app]\n" if $v;487 print "+++ Actual occupancy$session_number ($app): tot:",scalar keys %{$sessions[$app]},"; active: ", scalar keys %{$active_sessions[$app]},";inactive: ",scalar @{$inactive_sessions[$app]}," ;free: ",scalar @{$session_numbers_stack[$app]},"\n" if $v;490 print "\n+++ Created session $session_number ($app): tot:$n_sessions[$app]; active: $n_active_sessions[$app];inactive: $n_inactive_sessions[$app]\n" if $v; 491 print "+++ Occupancy for $session_number ($app): tot:",scalar keys %{$sessions[$app]},"; active: ", scalar keys %{$active_sessions[$app]},";inactive: ",scalar @{$inactive_sessions[$app]}," ;free: ",scalar @{$session_numbers_stack[$app]},"\n" if $v; 488 492 assert($n_sessions[$app]==$n_inactive_sessions[$app]+$n_active_sessions[$app]); 489 493 assert(scalar(keys %{$sessions[$app]})==scalar( keys %{$active_sessions[$app]})+scalar( @{$inactive_sessions[$app]})); … … 660 664 sub init_sessions { 661 665 for my $app ( 0 .. @Web::Terminal::Settings::commands - 1 ) { 666 662 667 @{ $session_numbers_stack[$app] } = 1 .. $n_max[$app]; 663 668 $n_inactive_sessions[$app] = 0; … … 668 673 669 674 if (&sane($app)) { 675 print "Creating sessions for $app\n" if $v; 670 676 for my $i ( 1 .. $Web::Terminal::Settings::npreloaded_sessions[$app] ) { 671 677 my $ret = &create_session($app); 672 print $ret>0?'OK: $ret': 'NOK',': #sesssions: ', scalar( @{ $inactive_sessions[$app] } ), ' for app ',678 print $ret>0?'OK: $ret':"NOK: $ret",': #sesssions: ', scalar( @{ $inactive_sessions[$app] } ), ' for app ', 673 679 $app, "\n" 674 680 if $v; 675 681 } 676 682 assert(scalar(@{ $inactive_sessions[$app] })==$Web::Terminal::Settings::npreloaded_sessions[$app]); 677 } 678 } 683 } else { 684 print "App $app is not sane. Skipped.\n" if $v; 685 } 686 } 679 687 } # END of init_sessions() 680 688 #------------------------------------------------------------------------------ 681 # check if command is sane (FSDO sane) 689 # Check if command is sane (FSDO sane) 690 # This should be part of settings. 682 691 sub sane { 683 692 my $app=shift; 684 693 my $cmd=$Web::Terminal::Settings::commands[$app]; 685 694 $cmd=~s/^.*nice\s+//; # de-nice 695 if ($cmd !~/pugs/) { 696 return 1; 697 } else { 686 698 my $reply=`PUGS_SAFEMODE=1 $cmd -e \"print 42\" 2>/dev/null`; 687 699 if ($reply==42) { … … 689 701 } else { 690 702 return 0; 691 } 703 }} 692 704 } 693 705 #------------------------------------------------------------------------------- … … 755 767 Web::Terminal::Dispatcher::send( 0, '127.0.0.1', 1, 1, 756 768 'Web::Terminal::Server::Sessions.clean-up' ); 757 print "call_clean_up() call returned: cleaned up <$ret> sessions\n" if $v; 769 if ($v) { 770 if($ret=~/[a-z]/) { 771 print "call_clean_up() call returned: $ret\n"; 772 } else { 773 print "call_clean_up() call returned: cleaned up <$ret> sessions\n"; 774 } 775 } 758 776 #( $ret < 1 ) ? "Nothing to clean up" : "OK", "\n" if $v; 759 777 -
misc/runpugs/lib/Web/Terminal/Server/Session.pm
r15408 r16218 3 3 use vars qw( $VERSION ); 4 4 $VERSION='0.3.0'; 5 use strict; 6 use utf8; 5 use Moose; 6 #use strict; 7 #use utf8; 7 8 use lib '.','../../..'; 8 9 use Web::Terminal::Settings; … … 14 15 $SIG{CHLD}='IGNORE'; 15 16 16 my $v=(1-$Web::Terminal::Settings::daemon)*(1-$Web::Terminal::Settings::test); 17 ## Constructor 18 sub new { 19 my $invocant = shift; 20 my $class = ref($invocant) || $invocant; 21 my $self = {@_}; 17 my $v=0*(1-$Web::Terminal::Settings::daemon)*(1-$Web::Terminal::Settings::test); 18 22 19 my $prompt ='/'.$Web::Terminal::Settings::prompt.'/'; 23 $self->{'prompt'}=$prompt; 24 $self->{'error'}=0; 25 $self->{'recent'}=[]; 26 print "Starting pugs session for ",$self->{'id'},"\n" if $v; 20 has 'prompt' => (is=>'rw',isa=>'Str', default => $prompt); 21 has 'error' => (is=>'rw',isa=>'Int',default=>0); 22 has 'output' => (is=>'rw',isa=>'Str'); 23 has 'recent'=> (is=>'rw',isa=>'ArrayRef',default=>sub {[]}); 24 has 'id' => (is=>'ro',isa=>'Str'); 25 has 'ip' => (is=>'ro',isa=>'Str'); 26 has 'app' => (is=>'ro',isa=>'Int'); 27 has 'ia' => (is=>'ro',isa=>'Int'); 28 has 'cmds' => (is=>'ro',isa=>'Str'); 29 has 'pugs' => (is=>'rw',isa=>'Str'); 30 has 'pty' => (is=>'rw',isa=>'Any'); 31 has 'pid' => (is=>'rw',isa=>'Int'); 32 33 sub BUILD { 34 my $self=shift; 35 print "Starting pugs session for ",$self->id,"\n" if $v; 27 36 ## Start pugs 28 my $app=$self-> {'app'};37 my $app=$self->app; 29 38 my $command=$Web::Terminal::Settings::commands[$app]; 30 39 if (not $Web::Terminal::Settings::test) { 31 if ($self-> {'ia'}==0) {40 if ($self->ia==0) { 32 41 #1. Create a file with the content of $cmd using $id.p6 for name, store in data 33 my $id=$self-> {'id'};34 open(P6,">$Web::Terminal::Settings::tmp_path/$id.p6") or ($self->{'error'}=1);35 if($self-> {'error'}==0) {36 print P6 $self-> {'cmds'};42 my $id=$self->id; 43 open(P6,">$Web::Terminal::Settings::tmp_path/$id.p6") or $self->error(1); 44 if($self->error==0) { 45 print P6 $self->cmds; 37 46 close P6; 38 47 $command.=" $Web::Terminal::Settings::tmp_path/$id.p6"; … … 40 49 } 41 50 ( $self->{'pty'},$self->{'pid'} ) = &spawn($command); # spawn() defined below 42 if ( $self-> {'pty'}==-1 and $self->{'pid'}==0) {51 if ( $self->pty==-1 and $self->pid==0) { 43 52 print "There was a problem starting pugs. Please try again later.\n" 44 53 if $v; 45 $self-> {'output'}= "\nThere was a problem starting pugs. Please try again later.";46 $self-> {'error'}=1;47 if ($self-> {'ia'}==0) {48 my $id=$self-> {'id'};54 $self->output("\nThere was a problem starting pugs. Please try again later."); 55 $self->error(1); 56 if ($self->ia==0) { 57 my $id=$self->id; 49 58 unlink "$Web::Terminal::Settings::tmp_path/$id.p6"; 50 59 } 51 60 } else { 52 61 ## Create a Net::Telnet object to perform I/O on pugs's tty. 62 print "Pugs started successfully. Creating Net::Telnet object as session handler...\n" if $v; 53 63 use Net::Telnet; 54 64 $self->{'pugs'} = new Net::Telnet( 55 -fhopen => $self-> {'pty'},65 -fhopen => $self->pty, 56 66 -timeout => $Web::Terminal::Settings::timeout_call, 57 67 -prompt => $prompt, … … 64 74 $self->{'pugs'} ="Test flag is set -- no session started for $command."; 65 75 } 66 bless($self,$class);76 print "Reading Pugs startup message...\n" if $v; 67 77 my $m=$self->readlines(); 68 78 if ($self->{'error'}==1 and not $Web::Terminal::Settings::test) { … … 78 88 $self->{'pugs'}->close(); 79 89 } 80 $self->{'output'}= $m; 81 90 $self->{'output'}= $m; 91 print "\nStatus is ",($self->{'error'}==1)?'ERROR':'OK',"\n" if $v; 92 print "Returning with output:\n",$m,"\n\n" if $v; 82 93 return $self; 83 94 } # END of new() constructor method 95 96 97 98 ### Constructor 99 #sub new { 100 # my $invocant = shift; 101 # my $class = ref($invocant) || $invocant; 102 # my $self = {@_}; 103 # my $prompt ='/'.$Web::Terminal::Settings::prompt.'/'; 104 # $self->{'prompt'}=$prompt; 105 # $self->{'error'}=0; 106 # $self->{'recent'}=[]; 107 # print "Starting pugs session for ",$self->{'id'},"\n" if $v; 108 # ## Start pugs 109 # my $app=$self->{'app'}; 110 # my $command=$Web::Terminal::Settings::commands[$app]; 111 # if (not $Web::Terminal::Settings::test) { 112 # if ($self->{'ia'}==0) { 113 # #1. Create a file with the content of $cmd using $id.p6 for name, store in data 114 # my $id=$self->{'id'}; 115 # open(P6,">$Web::Terminal::Settings::tmp_path/$id.p6") or ($self->{'error'}=1); 116 # if($self->{'error'}==0) { 117 # print P6 $self->{'cmds'}; 118 # close P6; 119 # $command.=" $Web::Terminal::Settings::tmp_path/$id.p6"; 120 # } 121 # } 122 # ( $self->{'pty'},$self->{'pid'} ) = &spawn($command); # spawn() defined below 123 # if ( $self->{'pty'}==-1 and $self->{'pid'}==0) { 124 # print "There was a problem starting pugs. Please try again later.\n" 125 # if $v; 126 # $self->{'output'}= "\nThere was a problem starting pugs. Please try again later."; 127 # $self->{'error'}=1; 128 # if ($self->{'ia'}==0) { 129 # my $id=$self->{'id'}; 130 # unlink "$Web::Terminal::Settings::tmp_path/$id.p6"; 131 # } 132 # } else { 133 # ## Create a Net::Telnet object to perform I/O on pugs's tty. 134 # print "Pugs started successfully. Creating Net::Telnet object as session handler...\n" if $v; 135 # use Net::Telnet; 136 # $self->{'pugs'} = new Net::Telnet( 137 # -fhopen => $self->{'pty'}, 138 # -timeout => $Web::Terminal::Settings::timeout_call, 139 # -prompt => $prompt, 140 # -telnetmode => 0, 141 # -cmd_remove_mode => 0, 142 # ); 143 # } 144 # } else { 145 # $self->{'pid'}=42; 146 # $self->{'pugs'} ="Test flag is set -- no session started for $command."; 147 # } 148 # bless($self,$class); 149 # print "Reading Pugs startup message...\n" if $v; 150 # my $m=$self->readlines(); 151 # #my $m=$self->write(''); 152 # if ($self->{'error'}==1 and not $Web::Terminal::Settings::test) { 153 # # should close the TTY 154 # $self->{'pty'}->close() unless ($self->{'pty'}==-1); 155 # $self->{'pugs'}->close(); 156 # } 157 # if ($self->{'ia'}==0 and not $Web::Terminal::Settings::test) { 158 # my $id=$self->{'id'}; 159 # unlink "$Web::Terminal::Settings::tmp_path/$id.p6"; 160 # # should close the TTY 161 # $self->{'pty'}->close() unless ($self->{'pty'}==-1); 162 # $self->{'pugs'}->close(); 163 # } 164 # $self->{'output'}= $m; 165 # print "\nStatus is ",($self->{'error'}==1)?'ERROR':'OK',"\n" if $v; 166 #print "Returning with output:\n",$m,"\n\n" if $v; 167 # return $self; 168 #} # END of new() constructor method 84 169 #------------------------------------------------------------------------------ 85 170 sub DESTROY { 86 171 my $obj = shift; 87 172 if (not $Web::Terminal::Settings::test) { 173 if (defined $obj->{'pty'}) { 88 174 $obj->{'pty'}->close(); 89 175 $obj->{'pty'}->close_slave(); 176 } 177 if (defined $obj->{'pugs'}) { 90 178 $obj->{'pugs'}->close(); 91 if($obj->{'pid'}>10){ 179 } 180 if(defined $obj->{'pid'} and $obj->{'pid'}>10){ 92 181 kill 9,$obj->{'pid'}; 93 182 } … … 114 203 $pugs->errmode(sub {kill 9,$obj->{'pid'};}); 115 204 116 $pugs->print($cmd) ;205 $pugs->print($cmd) unless $cmd eq ''; 117 206 while ($i<$Web::Terminal::Settings::nlines) { 118 207 my $line = $pugs->getline; … … 156 245 #------------------------------------------------------------------------------ 157 246 # Could be considered private; 158 # TODO: unifiy with write() 247 # Only used by the constructor 248 # The tacit assumption is that the MOTD is never too long 159 249 sub readlines { 160 250 my $obj = shift; 161 251 my $ps = ''; 162 my $i = 1;252 # my $i = 1; 163 253 my $lline = ''; 164 254 if (not $Web::Terminal::Settings::test) { 165 255 my $pugs=$obj->{'pugs'}; 166 256 $pugs->errmode(sub {kill 9,$obj->{'pid'}; }); 167 while ($i<$Web::Terminal::Settings::nlines) { 168 my $char=''; 257 # my $prev=0; 258 # while ($i<$Web::Terminal::Settings::nlines) { 259 # my $char=''; 169 260 my $line=''; 170 my $j=0; 171 while ($char ne "\n" and ($j<$Web::Terminal::Settings::nchars)) { 172 $char=$pugs->get(); 173 $j++; 174 last if $char eq ''; 175 $line.=$char; 176 last if $line eq $Web::Terminal::Settings::prompt; 177 } 178 print $line if $v; 179 if ($j>=$Web::Terminal::Settings::nchars-1) { 180 $line.="Generated output is limited to $Web::Terminal::Settings::nchars characters. Aborted.\n"; 181 $obj->{pugs}->close(); 182 kill 9, $obj->{'pid'}; 183 $obj->{'error'}=1; 184 $lline .= $line; 185 last; 186 } 261 # my $j=0; 262 263 # while ($char ne "\n" and ($j<$Web::Terminal::Settings::nchars)) { 264 # #$char=$pugs->get();# 265 # $char=getc $obj->{'pty'}; 266 # #if ($prev>0) { 267 # #print ord($char),"\t:char\n" if $v; 268 # #} 269 # #if (ord($char)!=27) { 270 # $j++; 271 # last if $char eq ''; 272 # $line.=$char; 273 # # print "{$line}\n"; 274 # last if $line =~/${Web::Terminal::Settings::prompt}$/; 275 # #} else {die;$prev=1;} 276 # } 277 278 ($line, $ps)=$pugs->waitfor(String=>$Web::Terminal::Settings::prompt); 279 $pugs->buffer_empty(); # maybe redundant, but play safe 280 # my @chars=split('',$line); 281 # for my $char(@chars) { 282 # print ord($char),"\n"; 283 # } 284 285 #$line=~s/....$//; 286 #print "L:<",$line,">" if $v; 287 #print "P:<",$ps,">" if $v; 288 # if ($line=~/Prelude/i){$prev++}; 289 #die if (($line=~/${Web::Terminal::Settings::prompt}/) and ($prev>1)); 290 291 # if ($j>=$Web::Terminal::Settings::nchars-1) { 292 # $line.="Generated output is limited to $Web::Terminal::Settings::nchars characters. Aborted.\n"; 293 # $obj->{pugs}->close(); 294 # kill 9, $obj->{'pid'}; 295 # $obj->{'error'}=1; 296 # $lline .= $line; 297 # last; 298 # } 187 299 my $msg=$pugs->errmsg; 188 300 if($msg=~/timed/) { … … 200 312 } 201 313 $msg=''; 202 if ( ($line =~ /$Web::Terminal::Settings::prompt_pattern/ or203 ($line=~/$Web::Terminal::Settings::quit_pattern/)) and $i > 1 ) { $ps = $1; last }314 # if ( ($line =~ /$Web::Terminal::Settings::prompt_pattern/ or 315 # ($line=~/$Web::Terminal::Settings::quit_pattern/)) and $i > 1 ) { $ps = $1; last } 204 316 $lline .= $line unless $line =~ 205 317 /$Web::Terminal::Settings::prompt_pattern/; 206 $i++;318 # $i++; 207 319 last if $line eq ''; 208 } 209 if ($i>=$Web::Terminal::Settings::nlines-1) { 210 $obj->{pugs}->close(); 211 kill 9, $obj->{'pid'}; 212 $lline.="Generated output is limited to $Web::Terminal::Settings::nlines lines. Aborted.\n"; 213 $obj->{'error'}=1; 214 } 320 # } 321 # if ($i>=$Web::Terminal::Settings::nlines-1) { 322 # $obj->{pugs}->close(); 323 # kill 9, $obj->{'pid'}; 324 # $lline.="Generated output is limited to $Web::Terminal::Settings::nlines lines. Aborted.\n"; 325 # $obj->{'error'}=1; 326 # } 327 215 328 } else { 216 329 $lline="Test flag is set -- readlines() called."; … … 235 348 }; 236 349 # 237 binmode $pty, ":utf8";350 #binmode $pty, ":utf8"; 238 351 ## Execute the program in another process. 239 352 unless ( $pid = fork ) { # child process … … 250 363 ## Associate process with a new controlling terminal. 251 364 $tty = $pty->slave; 252 binmode $tty, ":utf8";365 #binmode $tty, ":utf8"; 253 366 $tty_fd = $tty->fileno; 254 367 close $pty; … … 258 371 open STDOUT, ">&$tty_fd" or ($error=1);#die $!; 259 372 open STDERR, ">&STDOUT" or ($error=1);#die $!; 260 binmode STDIN, ":utf8";261 binmode STDOUT, ":utf8";262 binmode STDERR, ":utf8";373 #binmode STDIN, ":utf8"; 374 #binmode STDOUT, ":utf8"; 375 #binmode STDERR, ":utf8"; 263 376 close $tty; 264 377 … … 285 398 Web::Terminal::Server::Session -- Session object to encapsulate terminal 286 399 application. 287 Requires Net::Telnet .400 Requires Net::Telnet, Moose. 288 401 289 402 =head1 SYNOPSIS … … 305 418 This module provides a Session object. The object encapsulates the 306 419 actual terminal session. The session is configured via L<Settings.pm>. 307 The object's C<new> methodtakes following arguments:420 The object's constructor takes following arguments: 308 421 id: a string identifying the session 309 422 app: an integer indicating the version of the terminal application to … … 330 443 =head1 COPYRIGHT 331 444 332 Copyright (c) 2006 .Wim Vanderbauwhede. All rights reserved.445 Copyright (c) 2006,2007 Wim Vanderbauwhede. All rights reserved. 333 446 334 447 This program is free software; you can redistribute it and/or modify -
misc/runpugs/lib/Web/Terminal/Settings.pm
r16055 r16218 66 66 my $rel_root='/home/andara/pugs-rel'; 67 67 my $dev_root='/home/andara/pugs-dev'; 68 my $rel_lib="-I$rel_root/blib6/lib"; 69 my $dev_lib="-I$dev_root/blib6/lib"; 70 71 $ulimit=''; 72 $nice='';#/bin/nice'; 73 $pugs='/usr/bin/pugs'; 74 $rel_root='/usr/bin'; 75 $dev_root='/usr/bin'; 76 $rel_lib=''; 77 $dev_lib=''; 68 78 69 79 our @commands=( 70 "$ulimit $nice $rel_root/pugs -I$rel_root/blib6/lib", 71 "$ulimit $nice $dev_root/pugs -I$dev_root/blib6/lib" 80 "$ulimit $nice $rel_root/pugs $rel_lib", 81 "$ulimit $nice $dev_root/pugs $dev_lib", 82 "perl ./perl_repl.pl" 72 83 ); 73 84 … … 75 86 our $appname='runpugs'; 76 87 our $prompt='pugs> '; 88 #$prompt='perl> '; 77 89 our $prompt_pattern='(^(pugs|\.\.\.\.)>\s+)'; 78 90 our $quit_pattern='^Leaving\ pugs\.'; … … 99 111 100 112 our $restart_parent=0; # restart parent server from child if 1 101 our $server="$bin_path/termserv 4.pl"; # used to restart parent server from child113 our $server="$bin_path/termserv.pl"; # used to restart parent server from child 102 114 103 115 our $nsessions=50; # obsolete 104 our @n_max=(20,50 );116 our @n_max=(20,50,5); 105 117 our $nsessions_ip=10; 106 our @npreloaded_sessions=(5,10 );118 our @npreloaded_sessions=(5,10,2); 107 119 our @n_inactive_max=@npreloaded_sessions; 108 our @n_inactive_min=(2,5 );120 our @n_inactive_min=(2,5,0); 109 121 110 122 our $timeout_idle=90; # was 600 111 our $timeout_call= 30; # was 30
