nixpkgs/nixos
Andreas Rammhold 5e602f88d1
nixos/modules/services/networking/unbound: update systemd unit
Previously we just applied a very minimal set of restrictions and
trusted unbound to properly drop root privs and capabilities.

With this change I am (for the most part) just using the upstream
example unit file for unbound. The main difference is that we start
unbound was `unbound` user with the required capabilities instead of
letting unbound do the chroot & uid/gid changes.

The upstream unit configuration this is based on is a lot stricter with
all kinds of permissions then our previous variant. It also came with
the default of having the `Type` set to `notify`, therefore we are also
using the `unbound-with-systemd` package here. Unbound will start up,
read the configuration files and start listening on the configured ports
before systemd will declare the unit "running". This will likely help
with startup order and the occasional race condition during system
activation where the DNS service is started but not yet ready to answer
queries.

Aditionally to the much stricter runtime environmet I removed the
`/dev/urandom` mount lines we previously had in the code (that would
randomly fail during `stop`-phase).

The `preStart` script is now only required if we enabled the trust
anchor updates (which are still enabled by default).

Another beneefit of the refactoring is that we can now issue reloads via
either `pkill -HUP unbound` or `systemctl reload unbound` to reload the
running configuration without taking the daemon offline. A prerequisite
of this was that unbound configuration is available on a well known path
on the file system. I went for /etc/unbound/unbound.conf as that is the
default in the CLI tooling which in turn enables us to use
`unbound-control` without passing a custom configuration location.
2020-11-03 19:21:24 +01:00
..
doc nixos/manual: make reproducible (#102234) 2020-10-31 21:18:16 +01:00
lib make-disk-image: support legacy+gpt 2020-10-30 15:50:24 -04:00
maintainers Merge pull request #102174 from grahamc/ami-root-use-gpt 2020-10-30 16:14:37 -04:00
modules nixos/modules/services/networking/unbound: update systemd unit 2020-11-03 19:21:24 +01:00
tests Merge pull request #101192 from grahamc/nixpkgs-location-basic-auth 2020-11-02 09:44:54 -05:00
COPYING
default.nix
README treewide: use https for nixos.org and hydra.nixos.org 2020-05-03 22:14:21 -07:00
release-combined.nix nixosTests: Disable networking.networkd.macvlan 2020-08-30 17:43:34 -07:00
release-small.nix nixos/release-small: drop latestKernel.login 2020-04-19 22:20:07 +03:00
release.nix nixos/release: add pantheon closure 2020-07-26 15:30:08 -04:00

*** NixOS ***

NixOS is a Linux distribution based on the purely functional package
management system Nix.  More information can be found at
https://nixos.org/nixos and in the manual in doc/manual.