[oe] [meta-networking][PATCH] dnsmasq: get systemd only working again

Joe MacDonald Joe_MacDonald at mentor.com
Tue Apr 19 14:21:01 UTC 2016


[Re: [meta-networking][PATCH] dnsmasq: get systemd only working again] On 16.04.19 (Tue 09:41) Anders Darander wrote:

> * Joe MacDonald <joe_macdonald at mentor.com> [160419 05:29]:
> 
> > From: Mark Asselstine <mark.asselstine at windriver.com>
> 
> > The changes made in commit 2497cf2960537152427c99629b2af412787eb6c2
> > [dnsmasq: steal resolvconf support from Ubuntu] broke systemd only
> > dnsmasq runtime. No sysvinit scripts are included in systemd only
> > builds (and should not be) and the dnsmasq executable has not moved to
> > /usr/sbin.
> 
> > Reverting to the previous version of the systemd service file. If
> > folks want the local dnsmasq instance to be queried before going to
> > an external DNS they should add 'nameserver 127.0.0.1' to
> > /etc/resolv.conf. Or submit a change which will work with systemd.
> 
> > Signed-off-by: Mark Asselstine <mark.asselstine at windriver.com>
> > Signed-off-by: Joe MacDonald <joe_macdonald at mentor.com>
> > ---
> 
> > Mark,
> 
> > Thanks for the patch.  In the interests of not causing any more hassle
> > than I already have, I'm proposing this as an alternative to what you sent
> > earlier today.  This hopefully preserves the resolvconf/start-stop
> > functionality while not relying on any sysvinit-ness.  What do you think
> > about this as a middle-ground?
> 
> > Anders,
> 
> > I trust that nothing Mark and I are discussing here changes the issue you
> > noted about dnsmasq just falling over after a few minutes.  I propose we
> > dig into that separately, since it looks like a different problem probably
> > related to the uprev.  If it turns out that once we merge something to
> > support systemd-only builds that resolves the 'dnsmasq vandalizes itself'
> > issue, even better.
> 
> Well, I've tried this patch, but dnsmasq isn't running. Was it run-time
> tested?

Yes, it worked on my setup last night, but the testing I did was a bit
of a fake due to trying it out on a live system rather than waiting for
the filesystem generation to happen and copying it over to the target.
Thus the error you noted below.

> Isn't MAINPID the PID of the main process started by systemd?

In the case of Type=forking, $MAINPID is the value out of PIDFile unless
PIDFile is unset, then systemd needs to guess at the value (unless
you've also set GuessMainPID='no', in which case I have no idea what
happens, but the default is 'yes', so it shouldn't matter in this case).
At least that's my reading of the docs at
https://www.freedesktop.org/software/systemd/man/systemd.service.html,
I'm no expert when it comes to systemd service files, though, so please
correct me if I'm wrong.

> And -x should specify a path to the pid-file?

Yes, it absolutely should.

-J.

> Logs below.
> 
> Cheers,
> Anders
> 
> [FAILED] Failed to start DNS forwarder and DHCP server.
> See 'systemctl status dnsmasq.service' for details.
> 
> Running `systemctl status dnsmasq.service` gives:
> 
> [[0;1;31m●[[0m dnsmasq.service - DNS forwarder and DHCP server    Loaded: loaded (/lib/systemd/system/dnsmasq.service; enabled; vendor preset: enabled)
>    Active: [[0;1;31mfailed[[0m (Result: exit-code) since Fri 2016-04-08 11:07:27 CEST; 8min ago
>   Process: 384 ExecStart=/usr/bin/dnsmasq -x $MAINPID [[0;1;31m(code=exited, status=1/FAILURE)[[0m
>   Process: 381 ExecStartPre=/usr/bin/dnsmasq --test (code=exited, status=0/SUCCESS)
> 
> Apr 08 11:07:27 ccu systemd[1]: Starting DNS forwarder and DHCP server...
> Apr 08 11:07:27 ccu dnsmasq[381]: dnsmasq: syntax check OK.
> Apr 08 11:07:27 ccu dnsmasq[384]: dnsmasq: bad command line options: try --help
> Apr 08 11:07:27 ccu dnsmasq[384]: [[0;1;31mbad command line options: try --help[[0m
> Apr 08 11:07:27 ccu dnsmasq[384]: [[0;1;31mFAILED to start up[[0m 
> Apr 08 11:07:27 ccu systemd[1]: [[0;1;39mdnsmasq.service: Control process exited, code=exited status=1[[0m
> Apr 08 11:07:27 ccu systemd[1]: [[0;1;31mFailed to start DNS forwarder and DHCP server.[[0m
> Apr 08 11:07:27 ccu systemd[1]: [[0;1;39mdnsmasq.service: Unit entered failed state.[[0m
> Apr 08 11:07:27 ccu systemd[1]: [[0;1;39mdnsmasq.service: Failed with result 'exit-code'.[[0m
> 
-- 
-Joe MacDonald.
:wq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://lists.openembedded.org/pipermail/openembedded-devel/attachments/20160419/073d2b32/attachment-0002.sig>


More information about the Openembedded-devel mailing list