minidlna: use journalctl for logging, systemd for runtimedir

This commit is contained in:
Alexander Ried 2016-04-08 22:37:11 +02:00
parent 4d87926795
commit 72cd570421

View File

@ -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}";
};
};