From ec9009f8e493a01533bf738b6de44c16c5ea62b1 Mon Sep 17 00:00:00 2001 From: Alex <60006044+BuonHobo@users.noreply.github.com> Date: Thu, 14 Sep 2023 18:31:22 +0200 Subject: [PATCH] Jellyfin service starts after network-online.target To those who use Jellyfin's DLNA server, it can happen that the DLNA server starts before we are connected to the LAN. When this happens, Jellyfin only publishes the DLNA server on the local ports and is not discoverable by devices in the LAN. In order to fix this, I'm ensuring that Jellyfin starts after we are connected to the network, making it properly discoverable by DLNA clients. After making this change, Jellyfin's DLNA server is now working as expected on my machine. It used to be consistently undiscoverable. I verified that this doesn't break anything in situations where the LAN is not available: I disconnected my laptop from the network and rebooted it and Jellyfin started as expected. This change was informed by reading the suggestion in this article: https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/ --- nixos/modules/services/misc/jellyfin.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/misc/jellyfin.nix b/nixos/modules/services/misc/jellyfin.nix index 2a4483199d7d..43fdc09f4559 100644 --- a/nixos/modules/services/misc/jellyfin.nix +++ b/nixos/modules/services/misc/jellyfin.nix @@ -46,7 +46,8 @@ in config = mkIf cfg.enable { systemd.services.jellyfin = { description = "Jellyfin Media Server"; - after = [ "network.target" ]; + after = [ "network-online.target" ]; + wants = [ "network-online.target" ]; wantedBy = [ "multi-user.target" ]; # This is mostly follows: https://github.com/jellyfin/jellyfin/blob/master/fedora/jellyfin.service