send-uucp and funnels

Thomas Parmelan parmelan+inn at free.fr
Tue Sep 13 10:08:35 UTC 2005


Hello,

In the case of a site configured as a funnel, send-uucp needs to flush
the channel (or exploder) being used as the target of the funnel instead
of flushing the site. This is the only way to be sure that the
channel/exploder has finished writing to the site file.

The following patch adds a backward-compatible change to the send-uucp
configuration file to allow this.

Regards,
Tom


--- send-uucp.dist	2005-05-14 15:16:01.000000000 +0200
+++ send-uucp	2005-09-13 11:58:17.000000000 +0200
@@ -90,14 +90,15 @@
         my ($sitespec, $compress, $size, $time) = split(/\s+/);
         next if not $sitespec;
 
-        my ($site, $host) = split(/:/, $sitespec);
+        my ($site, $host, $funnel) = split(/:/, $sitespec);
         $host = $site if not $host;
+        $funnel = $site if not $funnel;
 
         $compress =~ s/_/ /g if $compress;
 
         if ($site_wanted) {
             if ($site eq $site_wanted) {
-                push @sites, [$site, $host, $compress, $size];
+                push @sites, [$site, $host, $funnel, $compress, $size];
                 last;
             }
             next;
@@ -106,10 +107,10 @@
         if ($time) {
             foreach my $time (split(/,/, $time)) {
                 next if $time != $hour;
-                push @sites, [$site, $host, $compress, $size];
+                push @sites, [$site, $host, $funnel, $compress, $size];
             }
         } else {
-            push @sites, [$site, $host, $compress, $size];
+            push @sites, [$site, $host, $funnel, $compress, $size];
         }
     }
     close CF;
@@ -140,7 +141,7 @@
 # batch articles for one site
 sub run_site {
     my ($cfg) = @_;
-    my ($site, $host, $compress, $size) = @$cfg;
+    my ($site, $host, $funnel, $compress, $size) = @$cfg;
 
     logmsg("checking site $site", 'debug');
     my $maxjobs = '';
@@ -173,7 +174,9 @@
     }
 
     rename($site, "$site.work") or logdie("cannot rename $site: $!", 'crit');
-    ctlinnd('-t120', 'flush', $site);
+    logmsg("Flushing $funnel for site $site", 'debug');
+    ctlinnd('-t120', 'flush', $funnel);
+
     if (not -s "$site.work") {
         logmsg("no articles for $site", 'debug');
         unlink "$site.work" or logmsg("cannot delete $site.work: $!", 'err');
@@ -267,7 +270,7 @@
 configuration file F<send-uucp.cf>.  Each site is specified with a line of
 the form:
 
-    site[:host] [compressor [maxsize [batchtime]]]
+    site[:host[:funnel]] [compressor [maxsize [batchtime]]]
 
 =over 4
 
@@ -281,6 +284,13 @@
 The UUCP host name to which batches should be sent for this site.
 If omitted, the news site name will be used as the UUCP host name.
 
+=item I<funnel>
+
+In the case of a site configured as a funnel, send-uucp needs to flush the
+channel (or exploder) being used as the target of the funnel instead of
+flushing the site.  This is the way to tell send-uucp about the name of the
+channel or exploder to flush for this site.
+
 =item I<compressor>
 
 The compression method to use for batches.  This should be one of compress,
@@ -317,8 +327,9 @@
     manhole         compress        1048576         5,18,22
     owl             compress        1048576
     able
+    pern::MYFUNNEL!
 
-This defines seven UUCP sites.  The first four use gzip compression and the
+This defines eight UUCP sites.  The first four use gzip compression and the
 last three use compress.  The first six use a batch size of 1MB, and the
 last site (able) uses the default of 500,000 bytes.  The zoetermeer,
 hoofddorp, pa3ebv, and manhole sites will only have batches generated for
@@ -326,6 +337,9 @@
 only have batches generated during those hours and 20:00, 00:00, and 02:00.
 There are no restrictions on when batches will be generated for owl or able.
 
+The pern site is configured as a funnel into "MYFUNNEL!", send-uucp will issue
+a "ctlinnd flush MYFUNNEL!" instead of "ctlinnd flush pern".
+
 =head1 FILES
 
 =over 4

-- 
Thomas Parmelan  -+-  tom at ankh.fr.EU.org


More information about the inn-workers mailing list