[Dnsmasq-discuss] [PATCH] Logging of dhcp_script output

Petr Mensik pemensik at redhat.com
Mon Mar 27 14:47:57 BST 2017


Well yes, you can redirect output to any file you want. It is not configurable however. And it cannot reuse any logging configuration you already have. You cannot use journalctl to list errors for example. You have to create place for dnsmasq to write that log and rotate it in regular intervals.

This solution is good for debugging your new script for the first time. It does not seem to good solution, if you want to log any problems in your long running service. Dnsmasq is used by libvirt for example, to provide DNS and DHCP on virtual subnet.

--
Petr Menšík
Software Engineer
Red Hat, http://www.redhat.com/
email: pemensik at redhat.com  PGP: 65C6C973


----- Original Message -----
From: "Alex Xu" <alex_y_xu at yahoo.ca>
To: dnsmasq-discuss at lists.thekelleys.org.uk
Sent: Friday, March 24, 2017 7:19:04 PM
Subject: Re: [Dnsmasq-discuss] [PATCH] Logging of dhcp_script output

On Fri, 24 Mar 2017 13:38:17 -0400 (EDT)
Petr Mensik <pemensik at redhat.com> wrote:

> Hi!
> 
> Some guys using dnsmasq in virtual machines and OpenStack use custom
> dhcp_script to manage leases of clients. However they complain if
> there is anything wrong with them, then are just told broken pipe and
> no information.
> 
> We understand it should not produce any output under normal
> operation. But it would be really helpful if at least anything was
> visible in logs. Especially for errors happening under rare
> circumstances. I have prepared patch to forward events from helper.
> It prevents SIGPIPE receiving if script does write anything. And logs
> it from dnsmasq. It seems very handy to me.
> 
> It was not simple to forward it to main log. I would like opinions if
> it is useful or dangerous. Do you consider it worth merging Simon?
> 
> Best Regards,
> Petr
> --
> Petr Menšík
> Software Engineer
> Red Hat, http://www.redhat.com/
> email: pemensik at redhat.com  PGP: 65C6C973
> 

you could also just put "exec >/var/log/whatever 2>&1" at the start of
your script. hell, you can even do "exec > >(logger) 2>&1" if you want.

_______________________________________________
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