/[meteor]/googlecode.com/svn/trunk/meteord
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /googlecode.com/svn/trunk/meteord

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 61 by andrew.betts, Tue Mar 25 00:38:17 2008 UTC revision 62 by andrew.betts, Thu Nov 27 00:33:21 2008 UTC
# Line 35  Line 35 
35  # meterod version  # meterod version
36  ################################################################################  ################################################################################
37                    
38          $::VERSION='1.06.01';          $::VERSION='1.06.02';
39          $::RELEASE_DATE='not yet released';          $::RELEASE_DATE='not yet released';
40    
41  ###############################################################################  ###############################################################################
# Line 116  Line 116 
116                          close(STDERR);                          close(STDERR);
117                          chdir("/");                          chdir("/");
118                          umask(0);                          umask(0);
119    
120                          # fork and exit parent                          # fork and exit parent
121                            print STDERR "Exit: Fork\n";
122                          exit if fork;                          exit if fork;
123                          setpgrp(0, $$) if defined $SIG{TTOU};                          setpgrp(0, $$) if defined $SIG{TTOU};
124                          $SIG{TTOU}='ignore' if defined $SIG{TTOU};                          $SIG{TTOU}='ignore' if defined $SIG{TTOU};
# Line 124  Line 126 
126                          # Avoid 'stdin reopened for output' warning with newer perls                          # Avoid 'stdin reopened for output' warning with newer perls
127                          open(NULL,'/dev/null');                          open(NULL,'/dev/null');
128                          <NULL> if(0);                          <NULL> if(0);
                           
129                          open(OUT,">/var/run/$::PGM.pid");                          open(OUT,">/var/run/$::PGM.pid");
130                          print OUT "$$\n";                          print OUT "$$\n";
131                          close(OUT);                          close(OUT);
132    
133                  }                  }
134                  else                  else
135                  {                  {
# Line 143  Line 145 
145          $SIG{'TERM'}=sub{$::TERM=1};          $SIG{'TERM'}=sub{$::TERM=1};
146          $SIG{'USR1'}=sub{$::USR1=1};          $SIG{'USR1'}=sub{$::USR1=1};
147          $SIG{'USR2'}=sub{$::USR2=1};          $SIG{'USR2'}=sub{$::USR2=1};
148                    $SIG{'PIPE'}=sub{&::syslog('info',"Signal PIPE received and ignored\n");};
149    
150          #          #
151          # Run server          # Run server
152          #          #
# Line 195  Line 198 
198                  {                  {
199                          while(!$::TERM)                          while(!$::TERM)
200                          {                          {
201    
202    
203                                  my $rVec=$serverVector;                                  my $rVec=$serverVector;
204                                  my $wVec='';                                  my $wVec='';
205                                  my $eVec='';                                  my $eVec='';
# Line 260  Line 265 
265                                                                                    
266                                          Meteor::Channel->clearAllBuffers();                                          Meteor::Channel->clearAllBuffers();
267                                  }                                  }
268                                    
269                                  if($::USR2)                                  if($::USR2)
270                                  {                                  {
271                                          $::USR2=0;                                          $::USR2=0;
# Line 269  Line 274 
274                                                                                    
275                                          Meteor::Document->clearDocuments()                                          Meteor::Document->clearDocuments()
276                                  }                                  }
277                                    
278                                  my $t=time;                                  my $t=time;
279                                  if($t>$lastAgeCheck+$AGE_CHECK_INTERVALL)                                  if($t>$lastAgeCheck+$AGE_CHECK_INTERVALL)
280                                  {                                  {
# Line 279  Line 284 
284                                          $t=$lastAgeCheck;                                          $t=$lastAgeCheck;
285                                                                                    
286                                          Meteor::Subscriber->checkPersistentConnectionsForMaxTime();                                          Meteor::Subscriber->checkPersistentConnectionsForMaxTime();
287                                            Meteor::Connection->destroyBadRequests();
288                                  }                                  }
289                                                                    
290                                  if(defined($nextPing) && $nextPing<=$t)                                  if(defined($nextPing) && $nextPing<=$t)
# Line 341  Line 347 
347                  {                  {
348                          &::syslog('info',"$cnt client(s) unresponsive, will shutdown anyway");                          &::syslog('info',"$cnt client(s) unresponsive, will shutdown anyway");
349                                                    
350                            print STDERR "Exit: TERM Shutdown (unresponsive clients)\n";
351                          exit(1);                          exit(1);
352                  }                  }
353                                    
354                  &::syslog('info',"shutdown succeeded");                  &::syslog('info',"shutdown succeeded");
355                                    
356                    print STDERR "Exit: TERM Shutdown (clean)\n";
357                  exit(0);                  exit(0);
358          }          }
359                    
# Line 379  sub handleUPD { Line 387  sub handleUPD {
387  }  }
388    
389  1;  1;
 ############################################################################EOF  
390    ############################################################################EOF

Legend:
Removed from v.61  
changed lines
  Added in v.62

  ViewVC Help
Powered by ViewVC 1.1.26