4

I've done my searching and can't find an answer to THIS specific issue. I have my minidlna set up and running - but it's not really done properly.

First off, when I open the server on my bluray player, all of my movies are listed twice - when they are certainly not saved on my external twice.

Second, when I open the server - rather than reading "Movies" "TV" "Music", etc - It just mashes all of my movies, tv, and some other folders all together with no real organization. I never had this problem when I had my Windows set up, so I know it's something configured improperly more-so than my external drive giving me gruff.

Here's my minidlna.conf file:

    # This is the configuration file for the MiniDLNA daemon, a DLNA/UPnP-AV media
# server.
#
# Unless otherwise noted, the commented out options show their default value.
#
# On Debian, you can also refer to the minidlna.conf(5) man page for
# documentation about this file.

media_dir=/media/somnambulist/Ghost In You
# This option can be specified more than once if you want multiple directories
# scanned.
#
# If you want to restrict a media_dir to a specific content type, you can
# prepend the directory name with a letter representing the type (A, P or V),
# followed by a comma, as so:
#   * "A" for audio    (eg. media_dir=A,/var/lib/minidlna/music)
#   * "P" for pictures (eg. media_dir=P,/var/lib/minidlna/pictures)
#   * "V" for video    (eg. media_dir=V,/var/lib/minidlna/videos)
#
# WARNING: After changing this option, you need to rebuild the database. Either
#          run minidlna with the '-R' option, or delete the 'files.db' file
#          from the db_dir directory (see below).
#          On Debian, you can run, as root, 'service minidlna force-reload' instead.
#media_dir=/var/lib/minidlna
media_dir=V,/media/somnambulist/Ghost In You/Movies
media_dir=V,/media/somnambulist/Ghost In You/TV
media_dir=P,/home/somnambulist/Pictures


# Path to the directory that should hold the database and album art cache.
db_dir=/home/somnambulist/serverart

# Path to the directory that should hold the log file.
log_dir=/home/somnambulist/serverlog

# Minimum level of importance of messages to be logged.
# Must be one of "off", "fatal", "error", "warn", "info" or "debug".
# "off" turns of logging entirely, "fatal" is the highest level of importance
# and "debug" the lowest.
#log_level=warn

# Use a different container as the root of the directory tree presented to
# clients. The possible values are:
#   * "." - standard container
#   * "B" - "Browse Directory"
#   * "M" - "Music"
#   * "P" - "Pictures"
#   * "V" - "Video"
# if you specify "B" and client device is audio-only then "Music/Folders" will be used as root
root_container=B

# Network interface(s) to bind to (e.g. eth0), comma delimited.
#network_interface=

# IPv4 address to listen on (e.g. 192.0.2.1).
#listening_ip=

# Port number for HTTP traffic (descriptions, SOAP, media transfer).
port=8200

# URL presented to clients.
# The default is the IP address of the server on port 80.
#presentation_url=http://example.com:80

# Name that the DLNA server presents to clients.
friendly_name=Somnambulist Media Server

# Serial number the server reports to clients.
serial=12345678

# Model name the server reports to clients.
#model_name=Windows Media Connect compatible (MiniDLNA)

# Model number the server reports to clients.
model_number=1

# Automatic discovery of new files in the media_dir directory.
#inotify=yes

# List of file names to look for when searching for album art. Names should be
# delimited with a forward slash ("/").
album_art_names=Cover.jpg/cover.jpg/AlbumArtSmall.jpg/albumartsmall.jpg/AlbumArt.jpg/albumart.jpg/Album.jpg/album.jpg/Folder.jpg/folder.jpg/Thumb.jpg/thumb.jpg

# Strictly adhere to DLNA standards.
# This allows server-side downscaling of very large JPEG images, which may
# decrease JPEG serving performance on (at least) Sony DLNA products.
#strict_dlna=no

# Support for streaming .jpg and .mp3 files to a TiVo supporting HMO.
#enable_tivo=no

# Notify interval, in seconds.
#notify_interval=895

# Path to the MiniSSDPd socket, for MiniSSDPd support.
#minissdpdsocket=/run/minissdpd.sock`

And here's the error I get in terminal when I run:

sudo service minidlna restart
sudo service minidlna force-reload

Force restart error:

Restarting DLNA/UPnP-AV media server minidlna                                
[2013/08/12 21:19:27] minidlna.c:474: error: Media directory "/media/somnambulist/Ghost In You/Movies" not accessible! [Permission denied]
[2013/08/12 21:19:27] minidlna.c:474: error: Media directory "/media/somnambulist/Ghost In You/TV" not accessible! [Permission denied]

Force-reload error:

Restarting DLNA/UPnP-AV media server minidlna                                
[2013/08/12 21:19:46] minidlna.c:474: error: Media directory "/media/somnambulist/Ghost In You/Movies" not accessible! [Permission denied]
[2013/08/12 21:19:46] minidlna.c:474: error: Media directory "/media/somnambulist/Ghost In You/TV" not accessible! [Permission denied]
rm: cannot remove ‘/home/somnambulist/serverart/files.db’: Permission denied
rm: cannot remove ‘/home/somnambulist/serverart/art_cache/media/somnambulist/Ghost In You/Movies/Slumdog Millionaire/Slumdog.Millionaire.Cover.jpg’: Permission denied
rm: cannot remove ‘/home/somnambulist/serverart/art_cache/media/somnambulist/Ghost In You/Movies/Zack and Miri Make a Porno/ZackAndMiriMakeAPornoCover.jpg’: Permission denied
[2013/08/12 21:19:46] minidlna.c:744: warn: Failed to clean old file cache.
                                                                         [ OK ]

I've spent hours on this at this point, read through various files - and even had a friend who is relatively Ubuntu-savvy try to help me via chat - no such luck.

Thanks in advance for any help.

1
  • The error you get on force-reload clarifies that you have a permission problem. For some reason, those files which it is trying to remove have the wrong permission. Try checking their permission and making them and their directories writable to the user the daemon is running with. Oct 18, 2013 at 3:05

4 Answers 4

3

Error is here

rm: cannot remove ‘/home/somnambulist/serverart/files.db’: Permission denied
rm: cannot remove ‘/home/somnambulist/serverart/art_cache/media/somnambulist/Ghost In You/Movies/Slumdog Millionaire/Slumdog.Millionaire.Cover.jpg’: Permission denied
rm: cannot remove ‘/home/somnambulist/serverart/art_cache/media/somnambulist/Ghost In You/Movies/Zack and Miri Make a Porno/ZackAndMiriMakeAPornoCover.jpg’: Permission denied
[2013/08/12 21:19:46] minidlna.c:744: warn: Failed to clean old file cache.

minidlna cannot delete old files so it fails. I'm having the same problem. Delete the old Art_cache folder and try again.

2

I am not an expert neither in ubuntu nor minidlna - but I got my minidlna server finally up an running on ubuntu server 12.04 (today!) and therefore came across some issues (and know how desperate one can be in case you are close to the target but not there).

First suspect: minidlna confuses something in its internal database. Therefore delete files.db, under Ubuntu 12.04 you need something like (potentially with sudo on top):

rm /var/lib/minidlna/files.db

and restart minidlna + wait (it will create the file anew)

Second suspect: You have some white spaces in your path:

/media/somnambulist/Ghost In You

Linux and some programming languages are a bit picky on that - potentially this could cause some issues internally in minidlna in case it is not properly dealt with.

Try instead:

/media/somnambulist/Ghost_In_You

(i.e. change the name of the directory plus the settings in the minidlna.conf file)

Potentially you need to delete the files.db again as well for this second suspect.

Whatever the outcome is on the second suspect - please post the result so that others can benefit as well. The first suspect/tip one can find on the web already.

No guarantees - but worth a try.

1

Your problem is file permissions. If you are new to Linux then you should invest a little time in understanding how the file permissions work.

The minidlna server runs as a separate process to you, and will normally have the username minidlna specified in the minidlna.conf file.

# Specify the user name or uid to run as.
user=minidlna

The database is normally in the directory

# Path to the directory that should hold the database and album art cache.
db_dir=/var/cache/minidlna

Check the permissions and owner of this directory

~$ stat /var/cache/minidlna
  File: /var/cache/minidlna
  Size: 4096        Blocks: 8          IO Block: 4096   directory
Device: 801h/2049d  Inode: 1967306     Links: 3
Access: (0750/drwxr-x---)  Uid: (  127/minidlna)   Gid: (  134/minidlna)
Access: 2020-04-26 11:39:36.340582338 +0100
Modify: 2020-07-07 08:35:11.796748628 +0100
Change: 2020-07-07 08:35:11.796748628 +0100
 Birth: 2020-04-26 11:39:36.340582338 +0100

In the Access the first rwx is the owner permissions, the r-x is the group permissions, and the last --- is global. So the minidlna users can read, write, and execute this file, the execute bit means you can do a file listing when applied to a directory. To see this in action try:

~$ ll /var/cache/minidlna/
ls: cannot open directory '/var/cache/minidlna/': Permission denied
~$ sudo ls -l /var/cache/minidlna/
total 4504
drwxr-xr-x 3 minidlna root    4096 Jul  7 08:35 art_cache
-rw-r--r-- 1 minidlna root 4603904 Nov  8 01:47 files.db

In the first ll command my normal user does not have the x permission on this directory. But the permissions for the database file are correctly set.

The other problem you mention is the squashing of the directory structure. This is partly a function of the client, but if the client supports it select folder based presentation. By default minidlna should have these options set.

# URL presented to clients (e.g. http://example.com:80).
presentation_url=/
# Set this to merge all media_dir base contents into the root container
# (The default is no.)
merge_media_dirs=no
-3

Try to change from umask=007 to umask=002 and remount partition. That will work for you.

1
  • umask only affects new files created, will not fix permissions on existing files.
    – Stuart
    Nov 8, 2020 at 9:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .