* Ulrich Weber <[email protected]> [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" != "" ]
> +     then
> +             kill -s HUP $DNSMASQ_PID
> +     fi
> +}
> +

please better use this:

reload_service()
{
        local pid
        read pid <'/var/run/dnsmasq.pid'
        [ -n "$pid" ] && kill -s HUP "$pid"
        return 0
}

bye, bastian
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to