[Dnsmasq-discuss] Logfile rotation

richardvoigt at gmail.com richardvoigt at gmail.com
Mon Jan 25 06:59:27 GMT 2010


On Sun, Jan 24, 2010 at 11:33 PM, Don Muller <don at djmuller.com> wrote:
> logrotate does not exist on the NAS. I can write a script to perform it on dnsmasq if someone would tell me what happens when dnsmasq receives SIGUSR2.

I strongly suspect that it closes its current file (by filehandle) and
opens again the same name.  Therefore you should relink (move/rename)
the existing logfile beforehand so that the open attempt finds no
existing file and creates a new one.

On POSIX, you can rename a file which is in use and all open
filehandles stay valid (writing the same file but with a different
name from before, IOs to a file don't involve the name except for open
itself).

>
> -----Original Message-----
> From: santiago.j.zarate at gmail.com [mailto:santiago.j.zarate at gmail.com] On Behalf Of Santiago Zarate
> Sent: Sunday, January 24, 2010 11:16 PM
> To: Don Muller
> Cc: dnsmasq-discuss at lists.thekelleys.org.uk
> Subject: Re: [Dnsmasq-discuss] Logfile rotation
>
> I would suggest you to use logrotate directly...:
> http://linux.die.net/man/8/logrotate
>
> 2010/1/24 Don Muller <don at djmuller.com>:
>> Hi,
>>
>>
>>
>> I just started using dnsmasq on my home network. It is running on my QNAP
>> TS-509 NAS and it works great!
>>
>>
>>
>> I have a question about log rotation. I know I have to send a SIGUSR2 to
>> perform a log rotation but what exactly happens? How does it work? I enabled
>> logging and there are messages being logged. I issued a “kill -12 pid of
>> dnsmasq” but nothing happened. IS the log supposed to be renamed and a new
>> one created using the same name specified in the conf file? I’ve read the
>> man page but I still can’ figure out how it works and what is supposed to
>> happen.
>>
>>
>>
>> Thanks
>>
>> Don
>>
>> _______________________________________________
>> Dnsmasq-discuss mailing list
>> Dnsmasq-discuss at lists.thekelleys.org.uk
>> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
>>
>>
>
>
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss at lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
>



More information about the Dnsmasq-discuss mailing list