[PATCH] innfeed does not reopen (rotated) log file
Florian Schlichting
fschlich at CIS.FU-Berlin.DE
Thu Sep 20 08:37:13 UTC 2012
Hello,
getting back to the original issue, an innfeed daemon on a funnel feed
keeping open a log file long deleted by scanlogs:
On Wed, Aug 08, 2012 at 10:54:57AM +0200, Florian Schlichting wrote:
> I just noticed that innfeed keeps open a deleted log/innfeed.log, while
> the current log/innfeed.log as well as all the available OLD logs are
> empty!
>
> The reason seems to be that rotation of innfeed.log was added to
> scanlogs for INN 2.5, but scanlogs doesn't send a signal for innfeed to
> reopen its log; and indeed there is (currently) no way to cause a
> running innfeed to do so.
>
> I think the assumption in scanlogs is that the LIVEFILES may be opened
> for writing at any time, even while scanlogs is processing them, but
> will only be held open for a short while. This is probably true for the
> other LIVEFILES (${NNTPSEND} ${SENDNNTP} ${SENDUUCP}), but innfeed.log
> is opened once at innfeed startup as its stdout and stderr, and remains
> open during its entire lifetime - which in funnel-file mode can be quite
> long!
Following is the patch I have been running with for the past month or
so, making scanlogs keep its hands off log/innfeed.log:
Subject: [PATCH] scanlogs.in: do not rotate innfeed.log, the
innfeed-daemon-on-a-funnel will hold on to the old, deleted
log
---
scripts/scanlogs.in | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/scripts/scanlogs.in b/scripts/scanlogs.in
index 213bad6..6ef1f60 100644
--- a/scripts/scanlogs.in
+++ b/scripts/scanlogs.in
@@ -22,21 +22,12 @@ ACTIVEFILE=${ACTIVE}
## Where these programs, if used, write their logs.
## We also have to find innfeed's log file.
CONTROLBATCH=${MOST_LOGS}/controlbatch.log
-INNFEEDCONF=${PATHETC}/innfeed.conf
-if [ -f "${INNFEEDCONF}" ]; then
- INNFEEDLOG=`${AWK} '{gsub(/:|#/, " & ")} {if ($1 == "log-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"
NNTPSEND=${MOST_LOGS}/nntpsend.log
PERLNOCEM=${MOST_LOGS}/perl-nocem.log
SENDIHAVE=${MOST_LOGS}/send-ihave.log
SENDNNTP=${MOST_LOGS}/send-nntp.log
SENDUUCP=${MOST_LOGS}/send-uucp.log
-LIVEFILES="${CONTROLBATCH} ${INNFEED} ${NNTPSEND} ${PERLNOCEM} ${SENDIHAVE} ${SENDNNTP} ${SENDUUCP}"
+LIVEFILES="${CONTROLBATCH} ${NNTPSEND} ${PERLNOCEM} ${SENDIHAVE} ${SENDNNTP} ${SENDUUCP}"
## Where news.daily places expire output, unless noexplog was used.
EXPLOG=${MOST_LOGS}/expire.log
Florian
More information about the inn-workers
mailing list