[Dnsmasq-discuss] addn-hosts marked inactive if it doesn't exist at startup
Simon Kelley
simon at thekelleys.org.uk
Mon Feb 2 21:14:50 GMT 2015
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
On 02/02/15 03:22, Alan wrote:
> I configured dnsmasq to read an additional hosts file using:
>
> addn-hosts=/var/run/openvpn/hosts.muvpn
>
> This file is created and updated by openvpn when users connect and
> disconnect via external script, I believe this is one of the
> intended use-cases of addn-hosts.
>
> The file isn't created until someone connects for the first time.
> The problem is that if the file doesn't exist when dnsmasq starts,
> it will not try to read it anymore even if it is created.
>
Are you sending SIGHUP to dnsmasq to ask it to re-read the file? If
not then it won't be read again, and even if you make changes they
won't be reflected in dnsmasq's configuration.
Looking at the code, I think non-existence of the file is not a fatal
error, so the creating the file is treated in exactly the same way as
modifying it: you have to send SIGUSR1 to get the changes into dnsmasq.
> The same happens if using a directory that hasn't been created by
> the time dnsmasq started.
Again, if you send SIGHUP, it should still work.
>
> It would be nice if this is fixed in dnsmasq instead of
> implementing a workaround.
There is a new facility in the latest dnsmasq code, to allow files to
be read incrementally as they appear or are changed, without needing
SIGHUP. It only works on Linux, and is somewhat experimental, but
it's work a look. See --hostsdir in the git repo HEAD branch.
Cheers,
Simon.
>
> Thanks.
>
> _______________________________________________ Dnsmasq-discuss
> mailing list Dnsmasq-discuss at lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQIcBAEBCAAGBQJUz+jKAAoJEBXN2mrhkTWi1k8P+wZEze2XZmjKHD2fbHhxgrMe
EUz237WBxW6DSeeqt4SG5SZQCCm6/I3W4XKcVujCWg/Bw1beIvoJn/ngphYUJwY0
0KfM4QIC8+8iIhnoJb/75rYD8Wu7NJbo20EIt59RK+g6AURoMwkxTcbwWoza+L5r
J0VWagrAkRsUUVJyC83tnD2d21AapLyj3dq0+jg4Z4qCiRJ54zBDLsHjehaUqhrS
icQamVpPwLT0o3Ln05OSOyWlUOSgeN2un7g0SsJxNOGGyc9ONEp597xx0YbQnRvj
6kTMutJxT8yjjuEUqb4zlHerM+mMRmyMBUIrRF3Tn5I5o+l0f+1kxe5EgmXIeirA
iVueIfFFITW6RoJ7JvUzCLhTiMV7pbIpXi1xv3WfUrhrWyWII9J/oxtNoapfKz3d
9+0adp3F2cPXYeoqEN26gaHXdcM7oQGP9jp2u9a+8iJAtQhFIr6D5GXzLrNU4HYW
I8PriTgw5upNarm45huetb0aGHDGC87D9tbv/fHsgv98hKemi2Sx/aQez/YvSaNQ
eY2aruRoLIu1FH4wGGsL0wocmuGEoBWQsbYfloN2XS+VAJM9SJuAWa3spUYjiEpX
Hi3PeG1ioRGQmBQcfwl2OvlxtsG+fIsOQxvnIyUtW5PCVAZ/5UZB82MCay7WwKTZ
iPKT6w3RSP6Zkg1T5Gly
=3VK0
-----END PGP SIGNATURE-----
More information about the Dnsmasq-discuss
mailing list