On Tue, Nov 22, 2016 at 1:56 PM, Mark Asselstine < [email protected]> wrote:
> This addition to dnsmasq allows an interface to define a dnsmasq > configuration file as /var/lib/dnsmasq/%i/dnsmasq.conf and have their > dnsmasq instance controlled via systemctl dnsmasq@%i.service (where > '%i' is the interface name). > > To use this simply create the dnsmasq.conf file as above and enable > the systemd service like: > > Signed-off-by: Mark Asselstine <[email protected]> > --- > recipes-support/dnsmasq/dnsmasq/[email protected] | 12 ++++++++++++ > recipes-support/dnsmasq/dnsmasq_2.%.bbappend | 16 ++++++++++++++++ > 2 files changed, 28 insertions(+) > create mode 100644 recipes-support/dnsmasq/dnsmasq/[email protected] > create mode 100644 recipes-support/dnsmasq/dnsmasq_2.%.bbappend > > diff --git a/recipes-support/dnsmasq/dnsmasq/[email protected] > b/recipes-support/dnsmasq/dnsmasq/[email protected] > new file mode 100644 > index 0000000..9e36a36 > --- /dev/null > +++ b/recipes-support/dnsmasq/dnsmasq/[email protected] > @@ -0,0 +1,12 @@ > +[Unit] > +Description=DHCP and DNS caching server for %i. > +After=network.target > + > +[Service] > +ExecStart=/usr/bin/dnsmasq -k --conf-file=/var/lib/dnsmasq/% > i/dnsmasq.conf > +ExecReload=/bin/kill -HUP $MAINPID > +Restart=on-failure > +RestartSec=5 > + > +[Install] > +WantedBy=multi-user.target > diff --git a/recipes-support/dnsmasq/dnsmasq_2.%.bbappend > b/recipes-support/dnsmasq/dnsmasq_2.%.bbappend > new file mode 100644 > index 0000000..2acfd0c > --- /dev/null > +++ b/recipes-support/dnsmasq/dnsmasq_2.%.bbappend > @@ -0,0 +1,16 @@ > +# Allow individual network interfaces to easily configure > +# their own dnsmasq instance. > + > +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" > + > +SRC_URI += " \ > + file://[email protected] \ > + " > + > Let me see if I properly understand this .. since this is bbappend, we are going to enable this service no matter what if dnsmasq is in an image ? Like the lxc networking, is there an option to put this into a separate package "dnsmasq-extra" .. or something better than that ? So that when someone wants this capability, they have to install the extra package ? Otherwise, I don't see a way to opt out. Bruce > +do_install_append() { > + install -d ${D}/${sysconfdir}/systemd > + install -d ${D}/${sysconfdir}/systemd/system > + install -m 644 ${WORKDIR}/[email protected] > ${D}/${sysconfdir}/systemd/system/. > +} > + > +FILES_${PN} += "${sysconfdir}/systemd/system/[email protected]" > -- > 2.7.4 > > -- > _______________________________________________ > meta-virtualization mailing list > [email protected] > https://lists.yoctoproject.org/listinfo/meta-virtualization > -- "Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end"
-- _______________________________________________ meta-virtualization mailing list [email protected] https://lists.yoctoproject.org/listinfo/meta-virtualization
