Dnsmasq keeps restarting

I'm setting up 2 LEDE routers in a fail over configuration. I got most things working including a script that calls /etc/init.d/dnsmasq stop when one router goes into backup state. The problem I'm having is dnsmasq get's restarted a few seconds after it's stopped and I can't find what's doing it. I've tried disabling dnsmasq with no luck. I observer the same behavior when I run /etc/intit.d/dnsmasq stop from the command line.

EDIT
I've noticed when I stop the dnsmasq service through luci it seems to stay stopped. If I could do whatever luci is doing from the command line that would accomplish my goal.

Thanks in advance for the help/

killall dnsmasq should work.