Send inn-workers mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.isc.org/mailman/listinfo/inn-workers
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of inn-workers digest..."


Today's Topics:

   1. Using patterns in incoming.conf for exclusion? (Jesse Rehmer)
   2. Re: [PATCH] innfeed does not reopen (rotated) log file
      (Florian Schlichting)
   3. innfeed issue (The Doctor)
   4. Re: Using patterns in incoming.conf for exclusion?
      (Florian Schlichting)


----------------------------------------------------------------------

Message: 1
Date: Wed, 27 Mar 2013 17:14:05 -0500
From: Jesse Rehmer <[email protected]>
To: "[email protected]" <[email protected]>
Subject: Using patterns in incoming.conf for exclusion?
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"

I was wondering if anyone was using the "patterns" directive in 
incoming.conf to limit newsgroups accepted by remote peers?  I've got a 
need to exclude *.sex.* and *.sex newsgroups.  While I'm working with my 
peers to exclude these on their end I found that the patterns directive 
in incoming.conf should be able to do this as well.

I've got the following configured in incoming.conf:

peer neva.ru {
         hostname:            newsfeed.neva.ru
         patterns: "*,!*.sex.*,!*.sex"
}

However, I'm still seeing articles coming in from that peer that match 
the exclude pattern.  Can you not use exclusions with the patterns key 
in incoming.conf?


$ grephistory '[email protected]'| sm -H
X-Received: by 10.180.98.103 with SMTP id eh7mr2425428wib.3.1364422078652;
         Wed, 27 Mar 2013 15:07:58 -0700 (PDT)
MIME-Version: 1.0
Path: 
usenet.blueworldhosting.com!goblin1!goblin.stu.neva.ru!yt3no10497887wib.0!news-out.google.com!p18ni21607wiv.0!nntp.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!82.197.221.133.MISMATCH!posting.tweaknews.nl!not-for-mail
From: [email protected]
Newsgroups: alt.sex.fetish.feet


Cheers,
Jesse
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<https://lists.isc.org/pipermail/inn-workers/attachments/20130327/10baaa10/attachment-0001.html>

------------------------------

Message: 2
Date: Thu, 28 Mar 2013 10:55:54 +0100
From: Florian Schlichting <[email protected]>
To: [email protected]
Subject: Re: [PATCH] innfeed does not reopen (rotated) log file
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"

Hi Julien,

thanks for your patch, and sorry for taking so long to really look at
it:

> > Related to the original issue, yesterday I noticed that ninpaths and
> > controlchan have a deleted log/OLD/errlog on stdout and stderr. Perhaps
> > 'ctlinnd flushlogs' as used in scanlogs should also cause flushing of
> > all channel / exploder feeds?
> 
> Would the following patch suit you?
> I believe it takes into account this new issue as well as the main problem
> that initiated your thread.

well it does indeed solve the new issue well, but it doesn't touch the
original issue as innfeed in funnel-file mode is a standalone daemon
that doesn't get restartet when innd flushes the funnel-file. So I
revisited your earlier suggestion to add a call to openLogFile() to the
sighup handler (sigusr1 is already used for increasing debug level), and
this is what I'm successfully running with now:

==========
Subject: [PATCH] innfeed, scanlogs: reopen log files on sighup

The recent patch to flush exploder and process channels in innd, and to
send 'ctlinnd flushlogs' again after log rotation solved the problem of
controlchan or ninpaths holding open an already deleted errlog file.
However this does not yet solve the original issue with innfeed.log when
innfeed is run as a standalone daemon via a funnel-file.

This patch implements the changes suggested by Julien Elie in January
2013, to add an openLogFile() call to the sighup handler. The sigusr1
handler is not available, as it is already used to increase / decrease
the debugging level along with sigusr2. Also, reopening the log after
re-reading the configuration might be a good idea anyway, as the log
file location may have been changed.

Additionally, call sighup on the innfeed pid in scanlogs, and document
the changes briefly in innfeed(8) / innfeed.conf(5).
---
 doc/pod/innfeed.conf.pod |  1 +
 doc/pod/innfeed.pod      |  2 +-
 innfeed/main.c           |  3 +++
 scripts/scanlogs.in      | 24 ++++++++++++++++++++++++
 4 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/doc/pod/innfeed.conf.pod b/doc/pod/innfeed.conf.pod
index 3702c12..660c1c3 100644
--- a/doc/pod/innfeed.conf.pod
+++ b/doc/pod/innfeed.conf.pod
@@ -692,6 +692,7 @@ changed (although note that I<bindaddress> and 
I<bindaddress6> changes
 will only affect new connections).
 
 Any new peers are added and any missing peers have their connections closed.
+The log file is reopened.
 
 =head1 EXAMPLE
 
diff --git a/doc/pod/innfeed.pod b/doc/pod/innfeed.pod
index 3604f2f..ab9bd86 100644
--- a/doc/pod/innfeed.pod
+++ b/doc/pod/innfeed.pod
@@ -141,7 +141,7 @@ on the command line, and will reopen it (see funnel file 
description above).
 B<innfeed> with catch SIGINT and will write a large debugging snapshot of
 the state of the running system.
 
-B<innfeed> will catch SIGHUP and will reload the config file.
+B<innfeed> will catch SIGHUP and will reload the config and log file.
 See innfeed.conf(5) for more details.
 
 B<innfeed> will catch SIGCHLD and will close and reopen all backlog files.
diff --git a/innfeed/main.c b/innfeed/main.c
index 3b27a65..9851edc 100644
--- a/innfeed/main.c
+++ b/innfeed/main.c
@@ -572,6 +572,9 @@ static void sighup (int sig UNUSED)
     }
 
   configHosts (talkToSelf) ;
+
+  notice ("ME reloading log file %s", logFile) ;
+  openLogFile() ;
 }
 
 static void sigemt (int sig UNUSED)
diff --git a/scripts/scanlogs.in b/scripts/scanlogs.in
index cba8311..225232d 100644
--- a/scripts/scanlogs.in
+++ b/scripts/scanlogs.in
@@ -25,12 +25,18 @@ CONTROLBATCH=${MOST_LOGS}/controlbatch.log
 INNFEEDCONF=${PATHETC}/innfeed.conf
 if [ -f "${INNFEEDCONF}" ]; then
     INNFEEDLOG=`${AWK} '{gsub(/:|#/, " & ")} {if ($1 == "log-file" && $2 == 
":") print $3}' ${INNFEEDCONF}`
+    INNFEEDPIDFILE=`${AWK} '{gsub(/:|#/, " & ")} {if ($1 == "pid-file" && $2 
== ":") print $3}' ${INNFEEDCONF}`
 fi
 INNFEED=
 for F in "${INNFEEDLOG}" ; do
     test -f "${MOST_LOGS}/${F}" && INNFEED="${INNFEED} ${MOST_LOGS}/${F}"
 done
 test -z "${INNFEED}" && test -f "${MOST_LOGS}/innfeed.log" && 
INNFEED="${MOST_LOGS}/innfeed.log"
+INNFEEDPID=
+for F in "${INNFEEDPIDFILE}" ; do
+    test -f "${PATHRUN}/${F}" && INNFEEDPID=`cat "${PATHRUN}/${F}"`
+done
+test -z "${INNFEEDPID}" && test -f "${PATHRUN}/innfeed.pid" && INNFEEDPID=`cat 
"${PATHRUN}/innfeed.pid"`
 NNTPSEND=${MOST_LOGS}/nntpsend.log
 PERLNOCEM=${MOST_LOGS}/perl-nocem.log
 SENDIHAVE=${MOST_LOGS}/send-ihave.log
@@ -121,6 +127,15 @@ if ${ROTATE} ; then
        rm -f ${LOCK}
        exit 1
     fi
+    if [ ! -z $INNFEEDPID ]; then
+        OUTPUT=`kill -HUP $INNFEEDPID 2>&1`
+        if [ "x$OUTPUT" != "x" ]; then
+            echo "$OUTPUT"
+            echo 'Cannot flush innfeed logs.'
+            rm -f ${LOCK}
+            exit 1
+        fi
+    fi
 
     ##  Make sure these .old files exist, in case innd is down.
     for F in ${LOG} ${ERRLOG} ; do
@@ -169,6 +184,15 @@ if ${ROTATE} ; then
         rm -f ${LOCK}
         exit 1
     fi
+    if [ ! -z $INNFEEDPID ]; then
+        OUTPUT=`kill -HUP $INNFEEDPID 2>&1`
+        if [ "x$OUTPUT" != "x" ]; then
+            echo "$OUTPUT"
+            echo 'Cannot flush innfeed logs.'
+            rm -f ${LOCK}
+            exit 1
+        fi
+    fi
 
     ${PAUSED} && ctlinnd -s go "Flushing log and syslog files" 2>&1
 

Florian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5565 bytes
Desc: not available
URL: 
<https://lists.isc.org/pipermail/inn-workers/attachments/20130328/68071eb7/attachment-0001.bin>

------------------------------

Message: 3
Date: Thu, 28 Mar 2013 04:42:35 -0600
From: The Doctor <[email protected]>
To: [email protected]
Subject: innfeed issue
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii

You might want to look again at can.canet.stats to see
if the problem is solved.
-- 
Member - Liberal International  This is [email protected] Ici [email protected]
God,Queen and country!Never Satan President Republic!Beware AntiChrist rising! 
http://www.fullyfollow.me/rootnl2k  Look at Psalms 14 amnd 53 on Atheism
I am a New World Order Enemy - I am an enemy of totalitarians and dictators.


------------------------------

Message: 4
Date: Thu, 28 Mar 2013 11:46:41 +0100
From: Florian Schlichting <[email protected]>
To: [email protected]
Subject: Re: Using patterns in incoming.conf for exclusion?
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"

Hi Jesse,

do you have wanttrash set to true in inn.conf?

> I was wondering if anyone was using the "patterns" directive in
> incoming.conf to limit newsgroups accepted by remote peers?  I've
> got a need to exclude *.sex.* and *.sex newsgroups.  While I'm
> working with my peers to exclude these on their end I found that the
> patterns directive in incoming.conf should be able to do this as
> well.

I don't use incoming patters, but the way newsfeeds work, the
newsgroups line of an article can only be checked *after* that article
has been received. A feeding server either sends all the articles it has
for a peer, or it asks if the peer wants a certain message-id, and then
sends that or not. There is a filter_messageid() function in
filter_innd.pl, but as said, the content of the Newsgroups header are
not known at that time.

Florian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5565 bytes
Desc: not available
URL: 
<https://lists.isc.org/pipermail/inn-workers/attachments/20130328/ecd1ad42/attachment.bin>

------------------------------

_______________________________________________
inn-workers mailing list
[email protected]
https://lists.isc.org/mailman/listinfo/inn-workers

End of inn-workers Digest, Vol 49, Issue 6
******************************************

Reply via email to