]> granicus.if.org Git - pdns/commitdiff
Add multi-instance unit file
authorPieter Lexis <pieter.lexis@powerdns.com>
Thu, 2 Nov 2017 16:28:56 +0000 (17:28 +0100)
committerPieter Lexis <pieter.lexis@powerdns.com>
Thu, 2 Nov 2017 16:28:56 +0000 (17:28 +0100)
pdns/dnsdistdist/.gitignore
pdns/dnsdistdist/Makefile.am
pdns/dnsdistdist/docs/advanced/index.rst
pdns/dnsdistdist/docs/advanced/multiple-instance.rst [new file with mode: 0644]

index 1bb513a65af31e01cefd0bf372b0810846f5e816..6878668c80a49c4f1f80aa619b5c60483c9e4bd3 100644 (file)
@@ -33,6 +33,7 @@
 /dnsmessage.pb.cc
 /dnsmessage.pb.h
 /dnsdist.service
+/dnsdist@.service
 /lua.hpp
 /test-driver
 dnsdist.pdf
index ce49afb0339ae0748713e33258d5a4844b155bdd..e31b373c7d40b06e490afaa17e555041bc47015a 100644 (file)
@@ -265,10 +265,14 @@ if HAVE_SYSTEMD
 dnsdist.service: dnsdist.service.in
        $(AM_V_GEN)sed -e 's![@]bindir[@]!$(bindir)!' < $< > $@
 
+dnsdist@.service: dnsdist.service
+       $(AM_V_GEN)sed -e 's!/dnsdist !&--config $(sysconfdir)/dnsdist-%i.conf !' < $< >$@
+
 systemdsystemunitdir = $(SYSTEMD_DIR)
 
 systemdsystemunit_DATA = \
-       dnsdist.service
+       dnsdist.service \
+       dnsdist@.service
 endif
 
 if !HAVE_LUA_HPP
index c16d04e2736ae2bed6aced9499894f5db08f4921..f9cc4ace693c5f8eefc084a427fad14cd8d200dc 100644 (file)
@@ -16,3 +16,4 @@ These chapters contain information on the advanced features of dnsdist
    tuning
    snmp
    axfr
+   multiple-instance
diff --git a/pdns/dnsdistdist/docs/advanced/multiple-instance.rst b/pdns/dnsdistdist/docs/advanced/multiple-instance.rst
new file mode 100644 (file)
index 0000000..7e870e1
--- /dev/null
@@ -0,0 +1,19 @@
+Running multiple instances
+==========================
+
+Sometimes, it can be advantageous to run multiple instances of :prog:`dnsdist`.
+Usecases can be:
+
+ * Multiple inbound IP addresses with different rulesets
+ * Taking advantage of more processes, using SO_REUSEPORT
+
+:prog:`dnsdist` supports loading a different configuration file with the ``--config`` command line switch.
+
+By default, ``SYSCONFDIR/dnsdist.conf`` is loaded. ``SYSCONFDIR`` is usually ``/etc`` or ``/etc/dnsdist``.
+
+Using systemd
+-------------
+.. versionadded:: 1.3.0
+
+On systems with systemd, instance services can be used.
+To create a dnsdist service named ``foo``, create a ``dnsdist-foo.conf`` in ``SYSCONFDIR``, then run ``systemctl enable dnsdist@foo.service`` and ``systemctl start dnsdist@foo.service``.