Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Jul 1995 10:14:55 -0400 (EDT)
From:      Mark Hittinger <bugs@ns1.win.net>
To:        hackers@freebsd.org, taylor-uucp@gnu.ai.mit.edu
Subject:   Large site patches for Taylor-UUCP
Message-ID:  <199507191414.KAA02302@ns1.win.net>

next in thread | raw e-mail | index | archive | help

Here is a list of what I did to make Taylor UUCP 1.05 run in a large 
environment under FreeBSD.  By large I mean around 100 megabytes of email 
a day, several hundred megabytes of news a day, thousands of users, and 
lots of calls.  The problems appear to be generic, and the solutions
within are probably of good use no matter which version of Unix you live
with :-).

I ran into the following three distinct problems:

1.  Taylor UUCP took a lot of cycles to read and parse my 'sys' file which
    was almost 300K.  I wrote some short patches to allow a default system.
    If the system desired is not in the 'sys' file then we use the default
    entry.  Now the 'sys' file is 567 bytes.  Big difference.

2.  Our WinNet-UK partner made me aware that each time uuxqt was invoked it 
    scanned the entire uucp tree looking for work.  They supplied me with
    patches to force uuxqt to run for a single target user only.  You have
    to double check things later with a scavenger uuxqt process that finds
    unrun X files.  Big difference.

3.  Mail delivery to a uucp user took longer than the receipt of the mail
    itself.  I modified the system to always queue incoming internet mail.
    I use smap/smapd (TIS) and smapd is modified to do "sendmail -odq".
    I modified rmail to always queue mail ( -DQUEUE_ONLY ).  This prevents
    an incoming mail pulse from overwelming your swap space and process
    limits.  Big difference at the peak load periods.

The combination of these three problems cause the uucp server to die during
the peak load periods, and provide poor service otherwise.

With the enclosed patches everything is fast, everybody is happy, and they
leave me alone! :-)

Caveats:

The diffs are against the FreeBSD variant of the Taylor-UUCP 1.05 tree.

The patches only work for Taylor config files.

The patches are not for all Unix systems!  They work for FreeBSD, and are small
enough that if you have another Unix box you can figure out what to do.

The patches were done in panic mode with a system under duress.  I needed to
solve my problem fast.

Patch set 1 : Allow a "default" system
--------------------------------------

Example last lines of "sys" file.  A default system for everybody and a
special entry for the special case.

system        default
protocol-parameter g timeout 20
protocol-parameter g retries 10
protocol-parameter g init-timeout  1
protocol-parameter g packet-size  64
system        hotlanta
called-login  hotlanta
protocol-parameter g timeout 20
protocol-parameter g retries 10
protocol-parameter g init-timeout  1
protocol-parameter g packet-size  4096

File: ./common_sources/uuconf.h  (add a boolean to signify that the entry was
                                  the default one)

*** uuconf.h_org	Fri Oct 21 23:51:22 1994
--- uuconf.h		Tue Jul 18 10:37:38 1995
***************
*** 191,192 ****
--- 191,194 ----
    char *uuconf_zalternate;
+   /* If non-zero, this was the default sys entry */
+   int uuconf_fdefault ;
    /* If non-zero, this alternate may be used for calling out.  */

File: ./libuuconf/sinfo.c             (If the system isn't found, make sure it
                                       is in the berkeley db'd password file
				       and make sure it is a uucp user.
				       If it is, then use the default entry)

*** sinfo.org	Sat Jul  8 15:08:24 1995
--- sinfo.c	Tue Jul 18 11:09:14 1995
***************
*** 26,27 ****
--- 26,29 ----
  #include "uucnfi.h"
+ #include <sys/types.h>
+ #include <pwd.h>
  
***************
*** 44,45 ****
--- 46,49 ----
    boolean fgot;
+   struct passwd *pw ;
+   char *system_name ;
  
***************
*** 49,50 ****
--- 53,83 ----
    iret = _uuconf_itaylor_system_internal (qglobal, zsystem, qsys);
+   if (iret == UUCONF_NOT_FOUND)
+   {
+      pw = getpwnam(zsystem) ;
+      if (pw == NULL)
+      {
+         iret = UUCONF_NOT_FOUND ;
+      }
+      else
+      {
+ 	  /* Must be a UUCP user, should be a macro below */
+         if (strcmp(pw->pw_shell,"/usr/libexec/uucp/uucico") == 0)
+         {
+            iret = _uuconf_itaylor_system_internal (qglobal, "default", qsys);
+ 	   if (iret == UUCONF_SUCCESS)
+ 	   {
+ 	      system_name = (char *) malloc((size_t) 16) ;
+ 	      strcpy(system_name,zsystem) ;
+               qsys->uuconf_zname = (char *)system_name ;
+ 	      qsys->uuconf_fdefault = 1 ;   /* OK but was the default entry */
+ 	   }
+         }
+         else
+            iret = UUCONF_NOT_FOUND ;
+       }
+   }
+   else
+   {
+      qsys->uuconf_fdefault = 0 ; /* OK and was not the default entry */
+   }
    if (iret == UUCONF_SUCCESS)

File: ./libuuconf/val.c                 (If default then emulate a called-login
                                         equals system-name.  Otherwise do the
					 standard validation)

*** val.org	Mon Jul 10 11:03:01 1995
--- val.c	Tue Jul 18 11:04:31 1995
***************
*** 41,42 ****
--- 41,49 ----
  #if HAVE_TAYLOR_CONFIG
+   if (qsys->uuconf_fdefault == 1)   /* If default do simple validation */
+   {
+      if (strcmp(qsys->uuconf_zname,zlogin) == 0) /* system=user? */
+         return UUCONF_SUCCESS ;
+      else
+         return UUCONF_NOT_FOUND ;
+   }                                 /* Otherwise validate normally */
    return uuconf_taylor_validate (pglobal, qsys, zlogin);

Patch set 2 : make uuxqt work for a target system only.  (I got this patch from
                                                          our WinNet-UK partner)

Example lines from my config file:

max-uuxqts     10                              # The maximum number of uuxqts
run-uuxqt      once                            # Run uuxqt after uucico exits

File: ./common_sources/system.h          (modify entry point to include system)

*** system.h_org	Sat Jul  8 20:08:11 1995
--- system.h	Sat Jul  8 20:08:45 1995
***************
*** 560,562 ****
     usysdep_get_xqt_free is called.  */
! extern boolean fsysdep_get_xqt_init P((void));
  
--- 560,562 ----
     usysdep_get_xqt_free is called.  */
! extern boolean fsysdep_get_xqt_init P((char *zsystem));
  
File: ./libunix/xqtfil.c                 (modify entry point to include system)

*** xqtfil.org	Sat Jul  8 20:12:53 1995
--- xqtfil.c	Sat Jul  8 20:16:51 1995
***************
*** 84,85 ****
--- 84,86 ----
  #endif /* SUBDIRS */
+ static char *zOnlySystem = NULL ;
<FF>
***************
*** 91,93 ****
  boolean
! fsysdep_get_xqt_init ()
  {
--- 92,95 ----
  boolean
! fsysdep_get_xqt_init (zsystem)
! char *zsystem;
  {
***************
*** 95,96 ****
--- 97,100 ----
  
+   zOnlySystem = zbufcpy (zsystem);
+ 
    qSxqt_topdir = opendir ((char *) ZDIR);
***************
*** 151,152 ****
--- 155,159 ----
  
+ 	  if (zOnlySystem != NULL && strcmp(qtop->d_name, zOnlySystem) != 0)
+ 	     continue ;
+ 
  	  DEBUG_MESSAGE1 (DEBUG_SPOOLDIR,
***************
*** 262,263 ****
--- 269,272 ----
    zSsystem = NULL;
+   ubuffree (zOnlySystem) ;
+   zOnlySystem = NULL ;
  #endif

File: ./uuxqt/uuxqt.c                 (modify entry point to include system)

*** uuxqt.org	Sat Jul  8 20:09:55 1995
--- uuxqt.c	Sat Jul  8 20:12:00 1995
***************
*** 250,252 ****
  
!       if (! fsysdep_get_xqt_init ())
  	{
--- 250,252 ----
  
!       if (! fsysdep_get_xqt_init (zdosys))
  	{

File: ./uustat/uustat.c                 (modify entry point to include system
                                         arg as NULL meaning everybody)

*** uustat.org	Sat Jul  8 20:09:07 1995
--- uustat.c	Sat Jul  8 20:09:37 1995
***************
*** 1424,1426 ****
  
!   if (! fsysdep_get_xqt_init ())
      return FALSE;
--- 1424,1426 ----
  
!   if (! fsysdep_get_xqt_init (NULL))
      return FALSE;
***************
*** 1963,1965 ****
    /* Get a count of all the execution files.  */
!   if (! fsysdep_get_xqt_init ())
      return FALSE;
--- 1963,1965 ----
    /* Get a count of all the execution files.  */
!   if (! fsysdep_get_xqt_init (NULL))
      return FALSE;


Good Luck!

Regards,

Mark Hittinger
bugs@win.net



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199507191414.KAA02302>