From 72cd570421d4a0f00a006bc2e5fc256692069380 Mon Sep 17 00:00:00 2001 From: Alexander Ried Date: Fri, 8 Apr 2016 22:37:11 +0200 Subject: [PATCH] minidlna: use journalctl for logging, systemd for runtimedir --- nixos/modules/services/networking/minidlna.nix | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/nixos/modules/services/networking/minidlna.nix b/nixos/modules/services/networking/minidlna.nix index bbbfe9d72e1a..61d063dbfe0e 100644 --- a/nixos/modules/services/networking/minidlna.nix +++ b/nixos/modules/services/networking/minidlna.nix @@ -60,7 +60,7 @@ in port=${toString port} friendly_name=${config.networking.hostName} MiniDLNA db_dir=/var/cache/minidlna - log_dir=/var/log/minidlna + log_level=warn inotify=yes ${concatMapStrings (dir: '' media_dir=${dir} @@ -83,21 +83,18 @@ in preStart = '' - mkdir -p /var/cache/minidlna /var/log/minidlna /run/minidlna - chown minidlna /var/cache/minidlna /var/log/minidlna /run/minidlna + mkdir -p /var/cache/minidlna + chown -R minidlna:minidlna /var/cache/minidlna ''; - # FIXME: log through the journal rather than - # /var/log/minidlna. The -d flag does that, but also raises - # the log level to debug... serviceConfig = { User = "minidlna"; - Group = "nogroup"; + Group = "minidlna"; PermissionsStartOnly = true; - Type = "forking"; + RuntimeDirectory = "minidlna"; PIDFile = "/run/minidlna/pid"; ExecStart = - "@${pkgs.minidlna}/sbin/minidlnad minidlnad -P /run/minidlna/pid" + + "${pkgs.minidlna}/sbin/minidlnad -S -P /run/minidlna/pid" + " -f ${pkgs.writeText "minidlna.conf" cfg.config}"; }; };