<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.26.3">
</HEAD>
<BODY>
I have had this occur intermittently in the past with Apache, solution was to restart apache on the postrotate, I'd still suggest doing this to avoid future occurences<BR>
<BR>
<BR>
Cheers<BR>
<BR>
Tim<BR>
<BR>
-----Original Message-----<BR>
<B>From</B>: <A HREF="mailto:knud.skrald@guldberg.info">knud.skrald@guldberg.info</A><BR>
<B>Cc</B>: DNS-DISCUSS &lt;<A HREF="mailto:DNS-DISCUSS%20%3cdnsmasq-discuss@lists.thekelleys.org.uk%3e">dnsmasq-discuss@lists.thekelleys.org.uk</A>&gt;<BR>
<B>Subject</B>: Re: [Dnsmasq-discuss] Logrotate again<BR>
<B>Date</B>: Thu, 29 Oct 2009 13:17:50 +0100<BR>
<BR>
<PRE>
Still working correct...

Strange !

Knud



&gt; Strange... this night it made the log rotation just as expected !
&gt; I have not changed anything...!
&gt; I will keep it under observation...
&gt;
&gt; Suggestion:
&gt; Could SIG's be written to the logfile ?
&gt; It would be nice in a case like this to see if the SIG is received by DNSMASQ
&gt;
&gt; Knud
&gt;
&gt;
&gt; Citat af Tim Allingham &lt;<A HREF="mailto:tim@theallinghams.com">tim@theallinghams.com</A>&gt;:
&gt;
&gt;&gt; Have you tried restarting the service after the logrotate?
&gt;
&gt; Yes then DNSMASQ use the new file instead the old handle
&gt;
&gt;&gt;
&gt;&gt; It sounds like the file handle is being kept open by dnsmasq, rather
&gt;&gt; then opened and closed per write.
&gt;&gt;
&gt; Yes my conclussion was the same
&gt;
&gt;&gt;
&gt;&gt; Restarting the service should kick it back onto writing into the new
&gt;&gt; file, as the handle will be re-initiated.  You can configure this as a
&gt;&gt; post-rotate action in your logrotate conf.
&gt;
&gt; Yes but so far I understand sigusr2 should actually close and reopen  
&gt; the log file
&gt;
&gt;&gt;
&gt;&gt; Cheers
&gt;&gt;
&gt;&gt; Tim
&gt;&gt;
&gt;&gt; -----Original Message-----
&gt;&gt; From: <A HREF="mailto:knud.skrald@guldberg.info">knud.skrald@guldberg.info</A>
&gt;&gt; To: <A HREF="mailto:dnsmasq-discuss@lists.thekelleys.org.uk">dnsmasq-discuss@lists.thekelleys.org.uk</A>
&gt;&gt; Subject: Re: [Dnsmasq-discuss] Logrotate again
&gt;&gt; Date: Tue, 27 Oct 2009 18:41:30 +0100
&gt;&gt;
&gt;&gt;
&gt;&gt; <A HREF="mailto:richardvoigt@gmail.com">richardvoigt@gmail.com</A> wrote:
&gt;&gt;&gt; On Tue, Oct 27, 2009 at 8:14 AM,  &lt;<A HREF="mailto:knud.skrald@guldberg.info">knud.skrald@guldberg.info</A>&gt; wrote:
&gt;&gt;&gt;&gt; Hi
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; I am new to this list...
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; As &lt;subj&gt; says...I have a problem getting logrotate to work
&gt;&gt;&gt;&gt; with the log file from dnsmasq.
&gt;&gt;&gt;&gt; I have searched the earlierer postings
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Problem:
&gt;&gt;&gt;&gt; When the logfile (dnsmasq) is rotated, dnsmasq log file is renamed to
&gt;&gt;&gt;&gt; dnsmasq-date-xxx as usual logfiles.
&gt;&gt;&gt;&gt; A new dnsmasq log file is created with size of zero bytes but it keeps
&gt;&gt;&gt;&gt; to be of size zero and dnsmasq-date-xxx is kepp growing in size eg.
&gt;&gt;&gt;&gt; dnsamsq is keep writing to this file instead of the newly created file.
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Sending &quot;kill -s SIGUSR2 `cat /var/run/dnsmasq.pid`&quot; from a command
&gt;&gt;&gt;&gt; prompt makes dnsmasq to write to the &quot;normal log file &quot;dnsmasq&quot;
&gt;&gt;&gt;
&gt;&gt;&gt; Command prompt of what user?  Does it work as the logrotate user?
&gt;&gt;
&gt;&gt; root
&gt;&gt; I have tried and another user ...non of the logrotate aktivities are
&gt;&gt; then allowed
&gt;&gt; I dont know which user the logrotate run under ..
&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;&gt;&gt; to setup:
&gt;&gt;&gt;&gt; fedora 11
&gt;&gt;&gt;&gt; dnsmasq 2.46 from the fedora 11 packaged
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; snip from logrotate.conf
&gt;&gt;&gt;&gt; /var/log/dnsmasq {
&gt;&gt;&gt;&gt;    missingok
&gt;&gt;&gt;&gt;    daily
&gt;&gt;&gt;&gt;    rotate 3
&gt;&gt;&gt;&gt;    size 100k
&gt;&gt;&gt;&gt;    create 0640 nobody root
&gt;&gt;&gt;&gt;    postrotate
&gt;&gt;&gt;&gt;       kill -s USR2 `cat /var/run/dnsmasq.pid`
&gt;&gt;&gt;
&gt;&gt;&gt; I'd try the usual suspects, such as writing to syslog from the
&gt;&gt;&gt; postrotate step to make sure it's being executed and the pid is as
&gt;&gt;&gt; expected (the file might not be readable, etc).
&gt;&gt;
&gt;&gt; Hmmm....just tested from root user(again)...now it works as expected
&gt;&gt; By setting the size to something small...and deleting the log file from
&gt;&gt; today
&gt;&gt;
&gt;&gt; logrotate -f /etc/logrotate.conf
&gt;&gt;
&gt;&gt; I will wait and see this night what happend
&gt;&gt;
&gt;&gt;
&gt;&gt;
&gt;&gt; Knud
&gt;&gt;
&gt;&gt; _______________________________________________
&gt;&gt; Dnsmasq-discuss mailing list
&gt;&gt; <A HREF="mailto:Dnsmasq-discuss@lists.thekelleys.org.uk">Dnsmasq-discuss@lists.thekelleys.org.uk</A>
&gt;&gt; <A HREF="http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss">http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss</A>
&gt;&gt;
&gt;
&gt;
&gt;



_______________________________________________
Dnsmasq-discuss mailing list
<A HREF="mailto:Dnsmasq-discuss@lists.thekelleys.org.uk">Dnsmasq-discuss@lists.thekelleys.org.uk</A>
<A HREF="http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss">http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss</A>
</PRE>
</BODY>
</HTML>