minidlna permission issue

Posted by zebul666 
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.
Now, this forum is in read-only mode. You find details Details hereContinue on /r/PirateBox
minidlna permission issue
June 16, 2015 02:21PM
hi.

I have installed piratebox on my rpi b+.

At the end of the post-install instructions, it is said to run
systemctl start minidlna
But it is not that simple. Running
systemctl status minidlna
shows it failed to start with permission issue.

minidlna can't create the sqlite database in /opt/piratebox/tmp. I fixed that with ACL, running
setfacl -m u:minidlna:rwx /opt/piratebox/tmp
setfacl -m mask::rwx /opt/piratebox/tmp

But this not enough. I have uploaded a file and the file dropped in /opt/piratebox/share/Shared has only -rw------- permission so it's not readable by minidlna again. so minidlna can't update its database...

How do I fix droppy config so that files droppped are 644 by default ? change its umask ?

Even though, I have manually changed permission of files in /opt/piratebox/share/Shared, I still can't see any files when I try to access minidlna with vlc from over the LAN. I don't know if it's vlc failing or minidlna.

Note: you really need to fix this mess...
Re: minidlna permission issue
June 18, 2015 05:36AM
Hi,

I tried your steps on my raspberry pi. My configuration might be different because I moved /opt/piratebox/share/Shared to my external usbdrive.
I am able to start the minidlna Service and it is now in status active(running).

Can you tell me more about your configuration?
Re: minidlna permission issue
June 18, 2015 09:25AM
If you use an external usbdrive, then it is the mount permission option that matters.

But in my case, I did not use any external drive. /opt/piratebox/share/Shared is the same as after the install. Except the change I made with getfacl.

And yes after the step I have described, the minidlna service is running with active status. The problem is that without those extra steps it is not by default.
Re: minidlna permission issue
June 18, 2015 10:26PM
Thank you for telling us about the problem.
We found the origin and will fix this in the next update.
I am going to update the post-install instruction very soon.
Re: minidlna permission issue
June 19, 2015 12:47AM
Why do files dropped in /opt/piratebox/share/Shared (via upload feature) get the wrong permission ?
Re: minidlna permission issue
June 19, 2015 08:25PM
There are two folders with ownership nobody.nogroup:
/opt/piratebox/tmp
/opt/piratebox/share

I modified the permission of the tmp folder to 777 and noticed the owner of the sqlite file was minidlna.minidlna.
This means, the permission was correct but ownership did not match the configured minidlna service in
/usr/lib/systemd/System/minidlna.service

This file is in the pacman package and we need to make sure that the different services work together without digging holes into the filesystem security.

I want to test this configuration before updating the build scripts and post installation instructions.
Re: minidlna permission issue
June 20, 2015 11:06AM
I'm glad you finally understood the problem ;-)

You can either use ACL like I did or force minidlna to run as nobody user or include it in nogroup group so that minidlna get the correct permisison to access the files it needs.