Send inn-committers mailing list submissions to inn-committers@lists.isc.org
To subscribe or unsubscribe via the World Wide Web, visit https://lists.isc.org/mailman/listinfo/inn-committers or, via email, send a message with subject or body 'help' to inn-committers-requ...@lists.isc.org You can reach the person managing the list at inn-committers-ow...@lists.isc.org When replying, please edit your Subject line so it is more specific than "Re: Contents of inn-committers digest..." Today's Topics: 1. INN commit: trunk (5 files) (INN Commit) 2. INN commit: trunk/doc/pod (install.pod) (INN Commit) 3. INN commit: branches/2.5/doc/pod (install.pod) (INN Commit) 4. INN commit: trunk (Makefile.global.in) (INN Commit) ---------------------------------------------------------------------- Message: 1 Date: Sat, 8 Jun 2013 07:49:37 -0700 (PDT) From: INN Commit <r...@isc.org> To: inn-committ...@isc.org Subject: INN commit: trunk (5 files) Message-ID: <20130608144937.720eb67...@hope.eyrie.org> Date: Saturday, June 8, 2013 @ 07:49:36 Author: iulius Revision: 9484 innfeed, scanlogs: reopen log files on sighup The recent patch [9464] 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). Thanks to Florian Schlichting for the patch. Modified: trunk/doc/pod/innfeed.conf.pod trunk/doc/pod/innfeed.pod trunk/doc/pod/news.pod trunk/innfeed/main.c trunk/scripts/scanlogs.in --------------------------+ doc/pod/innfeed.conf.pod | 2 ++ doc/pod/innfeed.pod | 4 ++-- doc/pod/news.pod | 15 +++++++++++---- innfeed/main.c | 3 +++ scripts/scanlogs.in | 24 ++++++++++++++---------- 5 files changed, 32 insertions(+), 16 deletions(-) Modified: doc/pod/innfeed.conf.pod =================================================================== --- doc/pod/innfeed.conf.pod 2013-06-06 20:10:20 UTC (rev 9483) +++ doc/pod/innfeed.conf.pod 2013-06-08 14:49:36 UTC (rev 9484) @@ -693,6 +693,8 @@ Any new peers are added and any missing peers have their connections closed. +The log file is also reopened. + =head1 EXAMPLE For a comprehensive example, see the sample F<innfeed.conf> distributed Modified: doc/pod/innfeed.pod =================================================================== --- doc/pod/innfeed.pod 2013-06-06 20:10:20 UTC (rev 9483) +++ doc/pod/innfeed.pod 2013-06-08 14:49:36 UTC (rev 9484) @@ -141,8 +141,8 @@ 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. -See innfeed.conf(5) for more details. +B<innfeed> will catch SIGHUP and will reload both the config and the +log files. See innfeed.conf(5) for more details. B<innfeed> will catch SIGCHLD and will close and reopen all backlog files. Modified: doc/pod/news.pod =================================================================== --- doc/pod/news.pod 2013-06-06 20:10:20 UTC (rev 9483) +++ doc/pod/news.pod 2013-06-08 14:49:36 UTC (rev 9484) @@ -138,13 +138,20 @@ =item * When using funnel feeds, B<innfeed> log files were open forever, which -resulted in empty log files, once rotated by B<scanlogs>. Exploder and -process channels are now reopened when C<ctlinnd flushlogs> is used, -which is in particular the command invoked by B<scanlogs> to rotate -log files. +resulted in empty log files, once rotated by B<scanlogs>. B<innfeed> +now reopens its log files upon receiving a HUP signal; this signal +is in particular sent by B<scanlogs> during log rotation. Thanks to +Florian Schlichting for the patch. =item * +Exploder and process channels are now reopened when C<ctlinnd flushlogs> +is used. Otherwise, they could hold open an already deleted F<errlog> +file. The issue affected in particular B<controlchan> or B<ninpaths>, +running as such channels. + +=item * + Fixed the occurrence of an unexpected C<cant select> error generated by B<innd>. Thanks to Paul Tomblin for having caught that long-standing issue. Modified: innfeed/main.c =================================================================== --- innfeed/main.c 2013-06-06 20:10:20 UTC (rev 9483) +++ innfeed/main.c 2013-06-08 14:49:36 UTC (rev 9484) @@ -572,6 +572,9 @@ } configHosts (talkToSelf) ; + + notice ("ME reloading log file %s", logFile) ; + openLogFile() ; } static void sigemt (int sig UNUSED) Modified: scripts/scanlogs.in =================================================================== --- scripts/scanlogs.in 2013-06-06 20:10:20 UTC (rev 9483) +++ scripts/scanlogs.in 2013-06-08 14:49:36 UTC (rev 9484) @@ -25,6 +25,7 @@ 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 @@ -112,8 +113,8 @@ PAUSED=false ctlinnd -s pause "Flushing log and syslog files" 2>&1 && PAUSED=true - # First, flush log files to be sure everything has been recorded - # before rotating them. + ## First, flush log files to be sure everything has been recorded + ## before rotating them. OUTPUT=`ctlinnd flushlogs 2>&1` if [ "$OUTPUT" != "Ok" -a "$OUTPUT" != "In debug mode" ]; then echo "$OUTPUT" @@ -160,14 +161,17 @@ ## Tally control messages if we logged them. test -n "${CONTROL_DATA}" && cat ${CONTROL_DATA} | ${TALLY_CONTROL} - # Flush again log files so that freshly rotated new log files - # are properly taken into account. - OUTPUT=`ctlinnd flushlogs 2>&1` - if [ "$OUTPUT" != "Ok" -a "$OUTPUT" != "In debug mode" ]; then - echo "$OUTPUT" - echo 'Cannot flush logs.' - rm -f ${LOCK} - exit 1 + ## Find out the PID of innfeed now and not at the beginning of scanlogs + ## because it is restarted when running ctlinnd flushlogs. + 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"` + + ## Send a HUP signal to innfeed so that it reopens its log files. + if [ ! -z ${INNFEEDPID} ]; then + kill -HUP ${INNFEEDPID} > /dev/null 2>&1 fi ${PAUSED} && ctlinnd -s go "Flushing log and syslog files" 2>&1 ------------------------------ Message: 2 Date: Sat, 8 Jun 2013 07:52:46 -0700 (PDT) From: INN Commit <r...@isc.org> To: inn-committ...@isc.org Subject: INN commit: trunk/doc/pod (install.pod) Message-ID: <20130608145246.28b7e67...@hope.eyrie.org> Date: Saturday, June 8, 2013 @ 07:52:45 Author: iulius Revision: 9485 mention in INSTALL that CNFS buffers are compatible between LFS and non-LFS versions Modified: trunk/doc/pod/install.pod -------------+ install.pod | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) Modified: install.pod =================================================================== --- install.pod 2013-06-08 14:49:36 UTC (rev 9484) +++ install.pod 2013-06-08 14:52:45 UTC (rev 9485) @@ -301,9 +301,9 @@ large that it exceeds S<2 GB> or you want to use CNFS buffers larger than S<2 GB>. -The history, tradindexed and buffindexed overview, CNFS, and timecaf -databases written by an INN built with this option are incompatible with -those written by an INN without this option. +The history, tradindexed and buffindexed overview, and timecaf databases +written by an INN built with this option are incompatible with those +written by an INN without this option. (CNFS buffers are compatible.) =item B<--enable-tagged-hash> ------------------------------ Message: 3 Date: Sat, 8 Jun 2013 07:53:32 -0700 (PDT) From: INN Commit <r...@isc.org> To: inn-committ...@isc.org Subject: INN commit: branches/2.5/doc/pod (install.pod) Message-ID: <20130608145332.61a1567...@hope.eyrie.org> Date: Saturday, June 8, 2013 @ 07:53:32 Author: iulius Revision: 9486 mention in INSTALL that CNFS buffers are compatible between LFS and non-LFS vers ions Modified: branches/2.5/doc/pod/install.pod -------------+ install.pod | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) Modified: install.pod =================================================================== --- install.pod 2013-06-08 14:52:45 UTC (rev 9485) +++ install.pod 2013-06-08 14:53:32 UTC (rev 9486) @@ -301,9 +301,9 @@ large that it exceeds S<2 GB> or you want to use CNFS buffers larger than S<2 GB>. -The history, tradindexed and buffindexed overview, CNFS, and timecaf -databases written by an INN built with this option are incompatible with -those written by an INN without this option. +The history, tradindexed and buffindexed overview, and timecaf databases +written by an INN built with this option are incompatible with those +written by an INN without this option. (CNFS buffers are compatible.) =item B<--enable-tagged-hash> ------------------------------ Message: 4 Date: Sat, 8 Jun 2013 07:55:08 -0700 (PDT) From: INN Commit <r...@isc.org> To: inn-committ...@isc.org Subject: INN commit: trunk (Makefile.global.in) Message-ID: <20130608145508.c601d67...@hope.eyrie.org> Date: Saturday, June 8, 2013 @ 07:55:08 Author: iulius Revision: 9487 add more gcc warnings to check (based on gcc 4.4.5) Modified: trunk/Makefile.global.in --------------------+ Makefile.global.in | 45 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 11 deletions(-) Modified: Makefile.global.in =================================================================== --- Makefile.global.in 2013-06-08 14:53:32 UTC (rev 9486) +++ Makefile.global.in 2013-06-08 14:55:08 UTC (rev 9487) @@ -68,27 +68,50 @@ ## useful warnings unless there's something that makes them unsuitable. In ## particular, the following warnings are *not* included: ## -## -ansi Requires messing with feature test macros. -## -pedantic Too much noise from embedded Perl. -## -Wtraditional We assume ANSI C, so these aren't interesting. -## -Wshadow Names like log or index are too convenient. -## -Wcast-qual Used for a while, but some casts are unavoidable. -## -Wconversion Too much unsigned to signed noise. -## -Wredundant-decls Too much noise from system headers. +## -ansi Requires messing with feature test macros. +## -pedantic Too much noise from embedded Perl. +## -Wswitch-default Quite annoying to enforce it. +## -Wstrict-overflow=2 Gives false positives. +## -Wtraditional We assume ANSI C, so these aren't interesting. +## -Wtraditional-conversion +## Warns about problems when upgrading from K&R to +## ANSI C, so these aren't interesting. +## -Wundef We need portability code. +## -Wshadow Names like log or index are too convenient. +## -Wunsafe-loop-optimizations +## Too much noise. +## -Wcast-qual Used for a while, but some casts are unavoidable. +## -Wconversion Too much unsigned to signed noise. +## -Waggregate-return Syntax allowed in C. +## -Wmissing-noreturn Not necessary (unless for optimization). +## -Wpacked Used by INN. +## -Wpadded Used by INN. +## -Wredundant-decls Too much noise from system headers. +## -Woverlength-strings Useless noise. ## ## Some may be worth looking at again once a released version of gcc doesn't ## warn on system headers. The warnings below are in the same order as ## they're listed in the gcc manual. ## -## Add -g because when building with warnings one generally also wants the +## Last checked against gcc 4.4.5 (2010-10-01). +## Add -g because when building with warnings, one generally also wants the ## debugging information, and add -O2 because gcc won't find some warnings ## without optimization turned on. Add -DDEBUG=1 so that we'll also ## compile all debugging code and check it as well. +## It would be worthwhile trying to enforce the following checks: +## -D_FORTIFY_SOURCE=2 enables warn_unused_result attribute markings +## on glibc functions on Linux, as well as more object size checking, +## which catches a few more issues. +## -Wformat=2, -Wswitch-enum, -Wfloat-equal, -Wlogical-op, +## "-Wconversion -Wno-sign-conversion", -Wmissing-format-attribute +## -Wunreachable-code, -Wstack-protector, -Wdeclaration-after-statement -WARNINGS = -g -O2 -DDEBUG=1 -Wall -W -Wendif-labels -Wpointer-arith \ +WARNINGS = -g -O2 -DDEBUG=1 -Werror -Wall -Wextra -Winit-self \ + -Wsync-nand -Wendif-labels -Wpointer-arith \ -Wbad-function-cast -Wcast-align -Wwrite-strings \ - -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs \ - -Werror + -Wstrict-prototypes -Wold-style-definition \ + -Wmissing-prototypes -Wmissing-declarations \ + -Wnormalized=nfc -Wnested-externs -Winline -Wvla ## Some warnings have to be suppressed for Perl, since there's no way to work ## around the Perl header problems in INN code. ------------------------------ _______________________________________________ inn-committers mailing list inn-committers@lists.isc.org https://lists.isc.org/mailman/listinfo/inn-committers End of inn-committers Digest, Vol 52, Issue 3 *********************************************