FS#31527 - [minidlna] Cache directory not created when using systemd

Attached to Project: Community Packages
Opened by Tim (tes) - Thursday, 13 September 2012, 13:36 GMT
Last edited by Sergej Pupykin (sergej) - Monday, 15 April 2013, 12:45 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 2
Private No

Details

Description:

When using systemd, the daemon will not start giving the error:

warn: make_dir: cannot create directory '/var/cache/minidlna'

Creating the directory with the correct rights will allow the server to start correctly.

Additional info:
minidlna 1.0.25-1
This task depends upon

Closed by  Sergej Pupykin (sergej)
Monday, 15 April 2013, 12:45 GMT
Reason for closing:  Not a bug
Comment by Albert Chaharbakhshi (albeec13) - Monday, 15 October 2012, 09:14 GMT
  • Field changed: Percent Complete (100% → 0%)
This is still broken as of Oct-15th.

If you add User=x and/or Group=x to minidlna.service, where x is a different user than nobody, the service will fail to run unless /var/cache/minidlna is chown'd to x:x and the service is restarted.

After a reboot, the owner of /var/cache/minidlna changes to nobody:nobody, even though user/group x:x is defined in minidlna.service.

I'm not sure what's causing the change in ownership (service shutdown, something during reboot?)
Comment by Sergej Pupykin (sergej) - Monday, 15 October 2012, 09:14 GMT
If you change user in .service file you must change it in /usr/lib/tmpfiles.d/minidlna.conf
Comment by Diego (cdprincipe) - Monday, 15 April 2013, 01:50 GMT
  • Field changed: Percent Complete (100% → 0%)
I have same issue described here.
When service start minidlna server start but files over the net are inaccessible
Comment by Diego (cdprincipe) - Monday, 15 April 2013, 07:37 GMT
I've solved...

_____________/usr/lib/systemd/system/minidlna-fix.service_________________
[Unit]
Description=miniDLNA
After=network.target

[Service]
Type=forking
ExecStart=/usr/sbin/minidlna -f /etc/minidlna.conf

[Install]
WantedBy=multi-user.target
____________________________________________________________________________


instead


________________/usr/lib/systemd/system/minidlna.service____________________

[Unit]
Description=minidlna server
After=network.target

[Service]
Type=forking
User=nobody
ExecStart=/usr/sbin/minidlna -P /var/run/minidlna/minidlna.pid
PIDFile=/var/run/minidlna/minidlna.pid

[Install]
WantedBy=multi-user.target
________________________________________________________________________________

I don't know why...
Comment by Sergej Pupykin (sergej) - Monday, 15 April 2013, 11:19 GMT
Because of you started it as root. Did you check file permissions?
Comment by Diego (cdprincipe) - Monday, 15 April 2013, 11:46 GMT
yes... but permission of what?
Library? Binary?
Comment by Sergej Pupykin (sergej) - Monday, 15 April 2013, 12:07 GMT
Owner and permission of /var/cache/minidlna and folder that you share.
Comment by Diego (cdprincipe) - Monday, 15 April 2013, 12:12 GMT
[diego@ippocrate ~]$ cd /var/cache/minidlna/
[diego@ippocrate minidlna]$ ls -alt
totale 784
-rw-r--r-- 1 root root 22159 15 apr 13.30 minidlna.log
-rw-r--r-- 1 root root 765952 15 apr 13.30 files.db
drwxr-xr-x 2 nobody nobody 4096 14 apr 14.46 .
drwxr-xr-x 8 root root 4096 12 apr 18.58 ..
[diego@ippocrate minidlna]$ cd /mnt/media/Video/
[diego@ippocrate Video]$ ls -alt
totale 24
drwxrwxrwx 5 root root 4096 14 apr 16.18 ..
drwx------ 17 diego users 4096 14 apr 14.50 Film
drwx------ 7 diego users 4096 13 apr 18.22 Cartoni animati
drwxr-xr-x 6 diego users 4096 12 apr 20.03 .
drwx------ 3 diego users 4096 12 apr 17.26 TV
drwx------ 2 diego users 4096 12 apr 17.25 Musica
[diego@ippocrate Video]$
Comment by Sergej Pupykin (sergej) - Monday, 15 April 2013, 12:44 GMT
minidlna starts from nobody user by default however your library owned by diego and has no access for other users.

It is not a bug, you can modify .service and tmpfiles.d config according to your needs.

Loading...