From 796264a708d85987e0e6a528203ade20462f3f9c Mon Sep 17 00:00:00 2001 From: Benno Fünfstück Date: Sat, 15 Oct 2016 22:30:50 +0200 Subject: nixos/avahi: use more upstream-like systemd units The new units mirror the upstream systemd units as closely as possible. I could not find a reason why the service would need to be restarted on resuming from suspend, and the upstream units also do not contain such a restriction, so I removed the `partOf = [ "post-resume.target"]`. This fixes #19525. --- nixos/modules/services/networking/avahi-daemon.nix | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'nixos/modules/services/networking') diff --git a/nixos/modules/services/networking/avahi-daemon.nix b/nixos/modules/services/networking/avahi-daemon.nix index ecc091d1d03..6a786e75bbc 100644 --- a/nixos/modules/services/networking/avahi-daemon.nix +++ b/nixos/modules/services/networking/avahi-daemon.nix @@ -175,11 +175,20 @@ in environment.systemPackages = [ pkgs.avahi ]; + systemd.sockets.avahi-daemon = + { description = "Avahi mDNS/DNS-SD Stack Activation Socket"; + listenStreams = [ "/var/run/avahi-daemon/socket" ]; + wantedBy = [ "sockets.target" ]; + }; + systemd.services.avahi-daemon = - { description = "Avahi daemon"; + { description = "Avahi mDNS/DNS-SD Stack"; wantedBy = [ "multi-user.target" ]; - # Receive restart event after resume - partOf = [ "post-resume.target" ]; + requires = [ "avahi-daemon.socket" ]; + + serviceConfig."NotifyAccess" = "main"; + serviceConfig."BusName" = "org.freedesktop.Avahi"; + serviceConfig."Type" = "dbus"; path = [ pkgs.coreutils pkgs.avahi ]; -- cgit 1.4.1