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] \ + " + +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
