<!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>
Have you tried restarting the service after the logrotate?<BR>
<BR>
It sounds like the file handle is being kept open by dnsmasq, rather then opened and closed per write.<BR>
<BR>
<BR>
Restarting the service should kick it back onto writing into the new file, as the handle will be re-initiated.&nbsp; You can configure this as a post-rotate action in your logrotate conf.<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>To</B>: <A HREF="mailto:dnsmasq-discuss@lists.thekelleys.org.uk">dnsmasq-discuss@lists.thekelleys.org.uk</A><BR>
<B>Subject</B>: Re: [Dnsmasq-discuss] Logrotate again<BR>
<B>Date</B>: Tue, 27 Oct 2009 18:41:30 +0100<BR>
<BR>
<PRE>
<A HREF="mailto:richardvoigt@gmail.com">richardvoigt@gmail.com</A> wrote:
&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; Hi
&gt;&gt;
&gt;&gt; I am new to this list...
&gt;&gt;
&gt;&gt; As &lt;subj&gt; says...I have a problem getting logrotate to work
&gt;&gt; with the log file from dnsmasq.
&gt;&gt; I have searched the earlierer postings
&gt;&gt;
&gt;&gt; Problem:
&gt;&gt; When the logfile (dnsmasq) is rotated, dnsmasq log file is renamed to
&gt;&gt; dnsmasq-date-xxx as usual logfiles.
&gt;&gt; A new dnsmasq log file is created with size of zero bytes but it keeps
&gt;&gt; to be of size zero and dnsmasq-date-xxx is kepp growing in size eg.
&gt;&gt; dnsamsq is keep writing to this file instead of the newly created file.
&gt;&gt;
&gt;&gt; Sending &quot;kill -s SIGUSR2 `cat /var/run/dnsmasq.pid`&quot; from a command
&gt;&gt; prompt makes dnsmasq to write to the &quot;normal log file &quot;dnsmasq&quot;
&gt; 
&gt; Command prompt of what user?  Does it work as the logrotate user?

root
I have tried and another user ...non of the logrotate aktivities are 
then allowed
I dont know which user the logrotate run under ..

&gt; 
&gt;&gt; to setup:
&gt;&gt; fedora 11
&gt;&gt; dnsmasq 2.46 from the fedora 11 packaged
&gt;&gt;
&gt;&gt; snip from logrotate.conf
&gt;&gt; /var/log/dnsmasq {
&gt;&gt;     missingok
&gt;&gt;     daily
&gt;&gt;     rotate 3
&gt;&gt;     size 100k
&gt;&gt;     create 0640 nobody root
&gt;&gt;     postrotate
&gt;&gt;        kill -s USR2 `cat /var/run/dnsmasq.pid`
&gt; 
&gt; I'd try the usual suspects, such as writing to syslog from the
&gt; postrotate step to make sure it's being executed and the pid is as
&gt; expected (the file might not be readable, etc).

Hmmm....just tested from root user(again)...now it works as expected
By setting the size to something small...and deleting the log file from 
today

logrotate -f /etc/logrotate.conf

I will wait and see this night what happend



Knud

_______________________________________________
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>