FS#71415 - minidlna.service file has CacheDirectory set which prevents it to start when the cache dir exists.

Attached to Project: Community Packages
Opened by Tomas M. (eldragon) - Thursday, 01 July 2021, 20:18 GMT
Last edited by Sergej Pupykin (sergej) - Thursday, 22 December 2022, 00:46 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sergej Pupykin (sergej)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Minidlna stores its database and thumbs at /var/cache/minidlna

Systemd on the other hand treats /var/cache/minidlna as a cache folder which wont survive service restarts and expects the directory to not exist when starting the service and CacheDirectory=minidlna exists in its service unit file.

the db_dir is supposed to be permanent.

Additional info:
* package version(s)
* config and/or log files etc.
* link to upstream bug report, if any

Steps to reproduce:
install minidlna and set it up. its cache dir is /var/cache/minidlna where it stores its db and thumbnails. This is expected to be readwrite and permanent (persists restarts of the service).

When starting after a reboot or restarting the service. it will fail with the following error:

Jul 01 16:15:25 emmet systemd[2222]: minidlna.service: Failed to set up special execution directory in /var/cache: File exists
Jul 01 16:15:25 emmet systemd[2222]: minidlna.service: Failed at step CACHE_DIRECTORY spawning /usr/bin/minidlnad: File exists

Clearing the variable Cachedirectory solves the problem.

From the documentation, the correct directory for semi-permanent data is /var/lib/ (StateDirectory) which would require minidlna.conf to define its db_dir to /var/lib/minidlna

Fix proposed:

changing db_dir to /var/lib/minidlna in minidlna.conf

adding an override for the systemd unit file minidlna.service with the following
[service]
ReadWritePaths=/var/lib/minidlna
CacheDirectory=
StateDirectory=minidlna

fixes the problem. The ReadWritePaths might be unnecessary.

This task depends upon

Closed by  Sergej Pupykin (sergej)
Thursday, 22 December 2022, 00:46 GMT
Reason for closing:  Works for me
Comment by Sergej Pupykin (sergej) - Tuesday, 15 November 2022, 10:47 GMT
I cannot reproduce it

Loading...