avoids nasty race condition between manual "dnsmasq restart" and
"killall -HUP dnsmasq" by dhcp client, killing the init script accidentially
Signed-off-by: Ulrich Weber
---
package/network/ipv6/6relayd/files/6relayd-update | 2 +-
package/network/services/dnsmasq/files/dnsmasq.init | 9 ++
Hi,
On 15/01/2014 11:43, Ulrich Weber wrote:
> avoids nasty race condition between manual "dnsmasq restart" and
> "killall -HUP dnsmasq" by dhcp client, killing the init script accidentially
please make a more elaborate description of what race you mean
John
> Signed-off-by: Ulrich Webe
if you enter "/etc/init.d/dnsmasq restart" and "killall -HUP dnsmasq"
(as in the dhcp scripts)
at the same time its racy. killall will also send a HUP signal to the
init script, which is killed then.
I found this while investigating a non running dnsmasq after system start.
Thought this was the
* Ulrich Weber [15.01.2014 20:05]:
> avoids nasty race condition between manual "dnsmasq restart" and
> "killall -HUP dnsmasq" by dhcp client, killing the init script accidentially
> +reload_service() {
> + DNSMASQ_PID=$(cat /var/run/dnsmasq.pid)
> +
> + if [ "$DNSMASQ_PID" != "" ]
> +
Found the bug I was searching for. Depending on the time dnsmasq needs
to stop, procd might already start a new process while the old process is
still exiting.
Can be reproduced if a sleep 1 is added in the exiting function of dnsmasq
and /etc/init.d/dnsmasq restart is executed.
Not sure whats t