[Date Prev] [Date Index] [Date Next] [Thread Prev] [Thread Index] [Thread Next]

7.1.4-beta patch

Bryan Stansell bryan@conserver.com
Sun, 16 Dec 2001 23:24:35 -0800


Well folks, I've attached a patch that will give you the
'auto-reconnect' feature that was discussed here.  It will try an
initial reconnect on a failure, and then continue to retry every minute
or so.  It all seems to work in my testing, but I'd love to know of any
successes or failures for anyone out there that uses it.

There were certain cases where consoles were 'forced down'...those
cases still exist.  For the other, "non-standard" cases, this new code
kicks in.  If you come across a 'forced down' case and it should really
be an auto-reconnect case, let me know.

Bryan
diff -cr conserver-7.1.3/CHANGES conserver-7.1.4-beta/CHANGES
*** conserver-7.1.3/CHANGES	Tue Oct 16 21:32:43 2001
--- conserver-7.1.4-beta/CHANGES	Sun Dec 16 23:12:33 2001
***************
*** 1,6 ****
--- 1,10 ----
  				CHANGES
  				=======
  
+ version 7.1.4-beta (Dec 16, 2001):
+ 	- Automatic reconnection of consoles on failures, retried every
+ 	  minute
+ 
  version 7.1.3 (Oct 16, 2001):
  	- NetBSD 1.5 termios bug/compatibility - patch by Andreas Wrede
  	  <aew.conserver@planix.com>
***************
*** 247,251 ****
  	  and enhancements of various types were applied.
  
  #
! #  $Id: CHANGES,v 1.50 2001-10-16 21:32:33-07 bryan Exp $
  #
--- 251,255 ----
  	  and enhancements of various types were applied.
  
  #
! #  $Id: CHANGES,v 1.50 2001-10-16 21:32:33-07 bryan Exp bryan $
  #
Common subdirectories: conserver-7.1.3/autologin and conserver-7.1.4-beta/autologin
Common subdirectories: conserver-7.1.3/conserver and conserver-7.1.4-beta/conserver
Common subdirectories: conserver-7.1.3/conserver.cf and conserver-7.1.4-beta/conserver.cf
diff -cr conserver-7.1.3/conserver.html conserver-7.1.4-beta/conserver.html
*** conserver-7.1.3/conserver.html	Tue Oct 16 21:33:13 2001
--- conserver-7.1.4-beta/conserver.html	Sun Dec 16 23:12:42 2001
***************
*** 167,176 ****
  
  <P>
  The current version, released on RELEASE_DATE, is <A
! HREF="http://www.conserver.com/7.1.3.tar.gz";>
! 7.1.3.tar.gz</A>.  You can get it via <A
! HREF="ftp://ftp.conserver.com/conserver/7.1.3.tar.gz";>FTP</A>
! or <A HREF="http://www.conserver.com/7.1.3.tar.gz";>HTTP</A>.
  See the <A HREF="http://www.conserver.com/CHANGES";>CHANGES</A> file for
  information on the latest updates.
  </P>
--- 167,176 ----
  
  <P>
  The current version, released on RELEASE_DATE, is <A
! HREF="http://www.conserver.com/7.1.4-beta.tar.gz";>
! 7.1.4-beta.tar.gz</A>.  You can get it via <A
! HREF="ftp://ftp.conserver.com/conserver/7.1.4-beta.tar.gz";>FTP</A>
! or <A HREF="http://www.conserver.com/7.1.4-beta.tar.gz";>HTTP</A>.
  See the <A HREF="http://www.conserver.com/CHANGES";>CHANGES</A> file for
  information on the latest updates.
  </P>
Common subdirectories: conserver-7.1.3/console and conserver-7.1.4-beta/console
Common subdirectories: conserver-7.1.3/contrib and conserver-7.1.4-beta/contrib
diff -cr conserver-7.1.3/conserver/consent.c conserver-7.1.4-beta/conserver/consent.c
*** conserver-7.1.3/conserver/consent.c	Tue Oct 16 12:03:05 2001
--- conserver-7.1.4-beta/conserver/consent.c	Sun Dec 16 22:59:03 2001
***************
*** 1,5 ****
  /*
!  *  $Id: consent.c,v 5.71 2001-10-16 12:02:30-07 bryan Exp $
   *
   *  Copyright conserver.com, 2000-2001
   *
--- 1,5 ----
  /*
!  *  $Id: consent.c,v 5.72 2001-12-16 22:58:59-08 bryan Exp $
   *
   *  Copyright conserver.com, 2000-2001
   *
***************
*** 571,576 ****
--- 571,577 ----
      }
      pCE->fup = 0;
      pCE->nolog = 0;
+     pCE->autoReUp = 0;
  }
  
  int
***************
*** 642,647 ****
--- 643,649 ----
  	}
      }
  
+     pCE->autoReUp = 0;
      pCE->fronly = 0;
      pCE->nolog = 0;
      (void)strcpy(pCE->acline, pCE->server);
diff -cr conserver-7.1.3/conserver/consent.h conserver-7.1.4-beta/conserver/consent.h
*** conserver-7.1.3/conserver/consent.h	Mon Jul 23 00:28:14 2001
--- conserver-7.1.4-beta/conserver/consent.h	Sun Dec 16 22:59:04 2001
***************
*** 1,5 ****
  /*
!  *  $Id: consent.h,v 5.22 2001-07-23 00:28:00-07 bryan Exp $
   *
   *  Copyright conserver.com, 2000-2001
   *
--- 1,5 ----
  /*
!  *  $Id: consent.h,v 5.23 2001-12-16 22:58:59-08 bryan Exp $
   *
   *  Copyright conserver.com, 2000-2001
   *
***************
*** 71,76 ****
--- 71,77 ----
      char networkConsoleHost[MAXSERVLEN];
      int networkConsolePort;
      int telnetState;
+     int autoReUp;
  
      /* used if virtual console */
      char acslave[MAXDEVLEN];	/* pseudo-device slave side             */
diff -cr conserver-7.1.3/conserver/group.c conserver-7.1.4-beta/conserver/group.c
*** conserver-7.1.3/conserver/group.c	Tue Oct 16 21:29:05 2001
--- conserver-7.1.4-beta/conserver/group.c	Sun Dec 16 22:59:31 2001
***************
*** 1,5 ****
  /*
!  *  $Id: group.c,v 5.140 2001-10-16 21:29:01-07 bryan Exp $
   *
   *  Copyright conserver.com, 2000-2001
   *
--- 1,5 ----
  /*
!  *  $Id: group.c,v 5.141 2001-12-16 22:59:06-08 bryan Exp $
   *
   *  Copyright conserver.com, 2000-2001
   *
***************
*** 189,195 ****
  }
  
  static void
! ReUp(pGE, prinit)
      GRPENT *pGE;
      fd_set *prinit;
  {
--- 189,195 ----
  }
  
  static void
! ReUp(pGE, automatic, prinit)
      GRPENT *pGE;
      fd_set *prinit;
  {
***************
*** 201,211 ****
      }
  
      for (i = 0, pCE = pGE->pCElist; i < pGE->imembers; ++i, ++pCE) {
! 	if (pCE->fup) {
  	    continue;
! 	}
! 	if (fNoinit)
! 	    continue;
  	ConsInit(pCE, prinit, 1);
      }
  }
--- 201,211 ----
      }
  
      for (i = 0, pCE = pGE->pCElist; i < pGE->imembers; ++i, ++pCE) {
! 	if (pCE->fup || fNoinit || (automatic && !pCE->autoReUp))
  	    continue;
! 	if (automatic)
! 	    Info("%s: automatic reinitialization [%s]", pCE->server,
! 		 strtime(NULL));
  	ConsInit(pCE, prinit, 1);
      }
  }
***************
*** 438,444 ****
  		pCE->pCLwr = (CONSCLIENT *) 0;
  	    }
  
! 	    ConsDown(pCE, prinit);
  	}
      }
  }
--- 438,451 ----
  		pCE->pCLwr = (CONSCLIENT *) 0;
  	    }
  
! 	    /* Try an initial reconnect */
! 	    Info("%s: automatic reinitialization [%s]", pCE->server,
! 		 strtime(NULL));
! 	    ConsInit(pCE, prinit, 0);
! 
! 	    /* If we didn't succeed, try again later */
! 	    if (!pCE->fup)
! 		pCE->autoReUp = 1;
  	}
      }
  }
***************
*** 681,686 ****
--- 688,694 ----
  	pCE[iConsole].pCLon = pCE[iConsole].pCLwr = (CONSCLIENT *) 0;
  	pCE[iConsole].fdlog = (CONSFILE *) 0;
  	pCE[iConsole].fdtty = -1;
+ 	pCE[iConsole].autoReUp = 0;
      }
      sprintf(CECtl.server, "ctl_%d", pGE->port);
      CECtl.inamelen = strlen(CECtl.server);	/* bogus, of course     */
***************
*** 754,764 ****
  	}
  	if (fSawReUp) {
  	    fSawReUp = 0;
! 	    ReUp(pGE, &rinit);
  	}
  	if (fSawMark) {
  	    fSawMark = 0;
  	    Mark(pGE, &rinit);
  	}
  
  	rmask = rinit;
--- 762,773 ----
  	}
  	if (fSawReUp) {
  	    fSawReUp = 0;
! 	    ReUp(pGE, 0, &rinit);
  	}
  	if (fSawMark) {
  	    fSawMark = 0;
  	    Mark(pGE, &rinit);
+ 	    ReUp(pGE, 1, &rinit);
  	}
  
  	rmask = rinit;
***************
*** 796,804 ****
  		    pCEServing->pCLwr = (CONSCLIENT *) 0;
  		}
  
! 		/*ConsInit(pCEServing, &rinit, 0); */
! 		ConsDown(pCEServing, &rinit);
  
  		continue;
  	    }
  	    Debug("Read %d bytes from fd %d", nr, pCEServing->fdtty);
--- 805,819 ----
  		    pCEServing->pCLwr = (CONSCLIENT *) 0;
  		}
  
! 		/* Try an initial reconnect */
! 		Info("%s: automatic reinitialization [%s]",
! 		     pCEServing->server, strtime(NULL));
! 		ConsInit(pCEServing, &rinit, 0);
  
+ 		/* If we didn't succeed, try again later */
+ 		if (!pCEServing->fup)
+ 		    pCEServing->autoReUp = 1;
+ 
  		continue;
  	    }
  	    Debug("Read %d bytes from fd %d", nr, pCEServing->fdtty);
diff -cr conserver-7.1.3/conserver/version.h conserver-7.1.4-beta/conserver/version.h
*** conserver-7.1.3/conserver/version.h	Tue Oct 16 21:08:30 2001
--- conserver-7.1.4-beta/conserver/version.h	Sun Dec 16 23:10:33 2001
***************
*** 1,5 ****
  /*
!  *  $Id: version.h,v 1.29 2001-10-16 21:08:28-07 bryan Exp $
   *
   *  Copyright conserver.com, 2000-2001
   *
--- 1,5 ----
  /*
!  *  $Id: version.h,v 1.29 2001-10-16 21:08:28-07 bryan Exp bryan $
   *
   *  Copyright conserver.com, 2000-2001
   *
***************
*** 14,17 ****
  @(#) Copyright 2000 conserver.com.\n\
  All rights reserved.\n"
  
! #define THIS_VERSION "conserver.com version 7.1.3"
--- 14,17 ----
  @(#) Copyright 2000 conserver.com.\n\
  All rights reserved.\n"
  
! #define THIS_VERSION "conserver.com version 7.1.4-beta"
diff -cr conserver-7.1.3/console/console.man conserver-7.1.4-beta/console/console.man
*** conserver-7.1.3/console/console.man	Mon Oct 15 22:46:20 2001
--- conserver-7.1.4-beta/console/console.man	Sat Dec  1 04:46:49 2001
***************
*** 1,4 ****
! .\" $Id: console.man,v 1.12 2001-10-15 22:46:09-07 bryan Exp $
  .TH CONSOLE 1 "Local"
  .SH NAME
  console \- console server client program
--- 1,4 ----
! .\" $Id: console.man,v 1.13 2001-12-01 04:46:37-08 bryan Exp $
  .TH CONSOLE 1 "Local"
  .SH NAME
  console \- console server client program
***************
*** 115,121 ****
  Display the pid of the master daemon process on each server.
  .TP
  .B \-q
! The \fBconsole\fP client requests that the server daemon quit (shut down).
  A password is sent in the protocol stream; if none is required for
  the local host to shut down the server, just press <return>.
  .TP
--- 115,122 ----
  Display the pid of the master daemon process on each server.
  .TP
  .B \-q
! The \fBconsole\fP client connects to each server to request
! that the server daemon quit (shut down).
  A password is sent in the protocol stream; if none is required for
  the local host to shut down the server, just press <return>.
  .TP
Common subdirectories: conserver-7.1.3/contrib/redhat-rpm and conserver-7.1.4-beta/contrib/redhat-rpm
Common subdirectories: conserver-7.1.3/contrib/solaris-package and conserver-7.1.4-beta/contrib/solaris-package
diff -cr conserver-7.1.3/contrib/redhat-rpm/conserver.spec conserver-7.1.4-beta/contrib/redhat-rpm/conserver.spec
*** conserver-7.1.3/contrib/redhat-rpm/conserver.spec	Tue Oct 16 21:33:13 2001
--- conserver-7.1.4-beta/contrib/redhat-rpm/conserver.spec	Sun Dec 16 23:12:42 2001
***************
*** 4,10 ****
  #
  
  %define pkg  conserver
! %define ver  7.1.3
  
  # define the name of the machine on which the main conserver
  # daemon will be running if you don't want to use the default
--- 4,10 ----
  #
  
  %define pkg  conserver
! %define ver  7.1.4-beta
  
  # define the name of the machine on which the main conserver
  # daemon will be running if you don't want to use the default
diff -cr conserver-7.1.3/contrib/solaris-package/pkginfo conserver-7.1.4-beta/contrib/solaris-package/pkginfo
*** conserver-7.1.3/contrib/solaris-package/pkginfo	Tue Oct 16 21:33:13 2001
--- conserver-7.1.4-beta/contrib/solaris-package/pkginfo	Sun Dec 16 23:12:42 2001
***************
*** 1,7 ****
  PKG="conserver"
  NAME="Console server and client"
  CATEGORY="system"
! VERSION="7.1.3"
  DESC="Console server and client"
  CLASSES=none
  ARCH=sparc
--- 1,7 ----
  PKG="conserver"
  NAME="Console server and client"
  CATEGORY="system"
! VERSION="7.1.4-beta"
  DESC="Console server and client"
  CLASSES=none
  ARCH=sparc