Re: [PATCH] Use SIGKILL to be able to immediately start a new dnsmasq afterwards




Date: Sat, 05 May 2012 15:03:42 +0200
From: Michael Stapelberg <michael+nm stapelberg de>

Hey,

attached you will find a patch which fixes a problem with dnsmasq for me. Quote
from the commit message:

Use SIGKILL to be able to immediately start a new dnsmasq afterwards

This fixes the problem that when updating the DNS configuration, dnsmasq would
fail to start up with a message like this:

May  5 14:43:47 x200 dnsmasq[5172]: failed to create listening socket for
127.0.0.1: Address already in use
May  5 14:43:47 x200 dnsmasq[5172]: FAILED to start up

The reason for that is that the other dnsmasq instance is still running ? it
doesn?t react to SIGTERM at all, so it was still running and NM was waiting for
the 2-second timeout to happen.

You can easily verify that dnsmasq doesn?t react to SIGTERM:

Killing and restarting dnsmasq each time you need to make a change has all the elegance of a kick in the groin. Problems like this wouldn't exist if you used DBUS to manage dnsmasq.

If my previous patch is a problem because you don't want to rely on an existing system-provided dnsmasq instance, the obvious solution is to add an option to dnsmasq to have instance-specific DBUS services, not to start/stop your private instance repeatedly every time the network topology changes.

--
  -- Howard Chu
  CTO, Symas Corp.           http://www.symas.com
  Director, Highland Sun     http://highlandsun.com/hyc/
  Chief Architect, OpenLDAP  http://www.openldap.org/project/




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]