Portál AbcLinuxu, 26. dubna 2024 07:48


Dotaz: minidlna a indexování souborů

pushkin avatar 23.8.2021 11:01 pushkin | skóre: 43 | blog: FluxBlog
minidlna a indexování souborů
Přečteno: 697×
Odpovědět | Admin

Zdravím všechny,
mám následující problém s indexováním souborů minidlna. Pokud soubory na disk uložím přímo z počítače, na kterém minidlna běží, bez problémů se naindexují a klienti je vidí. Pokud je uložím jinak (typicky přes sambu, ale dělají mi to například i soubory zkopírované z externího disku s ntfs), minidlna je "nevidí", takže je nenaindexuje a tím pádem je nevidí ani klienti.

Samozřejmě jsem začal s kontrolou přístupových práv, která jsou upravená tak, aby soubory mohl číst vlastník, skupina i všichni ostatní. Bohužel to nepomohlo.

Díky,
K.

🇺🇦 Pomoc pro obranu Ukrajiny | SOS Ukrajina | Web4Ukrajina | Web4Ukraine 🇺🇦

Řešení dotazu:


Nástroje: Začni sledovat (0) ?Zašle upozornění na váš email při vložení nového komentáře.

Odpovědi

Řešení 1× (pushkin (tazatel))
Gréta avatar 23.8.2021 12:01 Gréta | skóre: 36 | blog: Grétin blogísek | 🇮🇱==❤️ , 🇵🇸==💩 , 🇪🇺==☭
Rozbalit Rozbalit vše Re: minidlna a indexování souborů
Odpovědět | | Sbalit | Link | Blokovat | Admin

a když koukneš v čem se/vlastníkem/právama naindexovanej a nenaindexovanej soubor jakoby liší?? :O :O

hele člověkoj pomohlo vyrobit databázi znova když mu to blbnulo (muže trvat dlouho) :O :O problémek taky muže bejt ve vlastníkoj tý samotný databáze hele :O :O

oslavná píseň na pana soudruha generalisima prezidentčíka Petra Pavla Pávka 🎶🫡🦚🎶
pushkin avatar 23.8.2021 19:44 pushkin | skóre: 43 | blog: FluxBlog
Rozbalit Rozbalit vše Re: minidlna a indexování souborů
Jo,tak to zabralo. Minidlna je prostě jednou nenačetla, tak už je ignorovala navždy, prevít.
Max avatar 23.8.2021 12:28 Max | skóre: 72 | blog: Max_Devaine
Rozbalit Rozbalit vše Re: minidlna a indexování souborů
Odpovědět | | Sbalit | Link | Blokovat | Admin
Ahoj,
používám a nemám problém. Pokud je minidlna nevidí ani při pokusu o přeindexaci, tak prostě problém s právy.
Moje konfigurace (Debian 9 a 10):
# Specify the user name or uid to run as.
user=minidlna

#   * "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)
media_dir=V,/mnt/datastore/video

db_dir=/var/cache/minidlna
log_dir=/var/log
log_level=info
#   * "." - standard container
#   * "B" - "Browse Directory"
#   * "M" - "Music"
#   * "P" - "Pictures"
#   * "V" - "Video"
root_container=V
network_interface=enp1s0
max_connections=100
port=8200
presentation_url=http://192.168.1.1:8200/
friendly_name=HomeDLNA
serial=681019810597110
model_name=Windows Media Connect compatible (MiniDLNA)
model_number=1
inotify=yes

album_art_names=Cover.jpg/cover.jpg/AlbumArtSmall.jpg/albumartsmall.jpg
album_art_names=AlbumArt.jpg/albumart.jpg/Album.jpg/album.jpg
album_art_names=Folder.jpg/folder.jpg/Thumb.jpg/thumb.jpg

strict_dlna=no
enable_tivo=no
notify_interval=15
minissdpdsocket=/run/minissdpd.sock
a systemd unita:
[Unit]
Description=MiniDLNA is a DLNA/UPnP-AV server software
After=local-fs.target network.target

[Service]
User=minidlna
Group=minidlna
Type=simple
# drop root just before ExecStart to allow ExecStartPre to run as root
PermissionsStartOnly=true
# create PID directory
ExecStartPre=/bin/mkdir -p /var/run/minidlna
ExecStartPre=/bin/chown $USER /var/run/minidlna
ExecStart=/usr/sbin/minidlnad -S

[Install]
WantedBy=multi-user.target
Zdar Max
Měl jsem sen ... :(
pushkin avatar 23.8.2021 18:02 pushkin | skóre: 43 | blog: FluxBlog
Rozbalit Rozbalit vše Re: minidlna a indexování souborů
Moje konfigurace je následující (od Debianu 9, aktuálně na Debianu 11):
# 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.

# Specify the user name or uid to run as (root by default).
# On Debian system command line option (from /etc/default/minidlna) overrides this.
#user=minidlna


# Path to the directory you want scanned for media files.
#
# 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)
#   * "PV" for pictures and video (eg. media_dir=PV,/var/lib/minidlna/digital_camera)
media_dir=/home/media

# Set this to merge all media_dir base contents into the root container
# (The default is no.)
#merge_media_dirs=no

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

# Path to the directory that should hold the log file.
log_dir=/var/log

# Type and minimum level of importance of messages to be logged.
#
# The types are "artwork", "database", "general", "http", "inotify",
# "metadata", "scanner", "ssdp" and "tivo".
#
# The levels are "off", "fatal", "error", "warn", "info" or "debug".
# "off" turns of logging entirely, "fatal" is the highest level of importance
# and "debug" the lowest.
#
# The types are comma-separated, followed by an equal sign ("="), followed by a
# level that applies to the preceding types. This can be repeated, separating
# each of these constructs with a comma.
#
# The default is to log all types of messages at the "warn" level.
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"
#   * Or, you can specify the ObjectID of your desired root container
#     (eg. 1$F for Music/Playlists)
# If you specify "B" and the client device is audio-only then "Music/Folders"
# will be used as root.
#root_container=.

# Network interface(s) to bind to (e.g. eth0), comma delimited.
# This option can be specified more than once.
#network_interface=

# Port number for HTTP traffic (descriptions, SOAP, media transfer).
# This option is mandatory (or it must be specified on the command-line using
# "-p").
port=8200

# URL presented to clients (e.g. http://example.com:80).
#presentation_url=/

# Name that the DLNA server presents to clients.
# Defaults to "hostname: username".
friendly_name=pushkin-htpc

# Serial number the server reports to clients.
# Defaults to the MAC address of nework interface.
#serial=

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

# Model number the server reports to clients.
# Defaults to the version number of minidlna.
#model_number=

# 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 ("/").
# This option can be specified more than once.
#album_art_names=Cover.jpg/cover.jpg/AlbumArtSmall.jpg/albumartsmall.jpg
#album_art_names=AlbumArt.jpg/albumart.jpg/Album.jpg/album.jpg
#album_art_names=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

# Which method to use for registering in TiVo: 'bonjour' (default) or
# legacy 'beacon'
tivo_discovery=bonjour

# SSDP notify interval, in seconds.
#notify_interval=895

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

# Always set SortCriteria to this value, regardless of the SortCriteria
# passed by the client
# e.g. force_sort_criteria=+upnp:class,+upnp:originalTrackNumber,+dc:title
force_sort_criteria=+upnp:originalTrackNumber

# maximum number of simultaneous connections
# note: many clients open several simultaneous connections while streaming
#max_connections=50

# set this to yes to allow symlinks that point outside user-defined media_dirs.
#wide_links=no
a unita
[Unit]
Description=MiniDLNA is a DLNA/UPnP-AV server software
After=local-fs.target network.target

[Service]
User=minidlna
Group=minidlna
Type=simple
# drop root just before ExecStart to allow ExecStartPre to run as root
PermissionsStartOnly=true
# create PID directory
ExecStartPre=/bin/mkdir -p /var/run/minidlna
ExecStartPre=/bin/chown $USER /var/run/minidlna
ExecStart=/usr/sbin/minidlnad -S

[Install]
WantedBy=multi-user.target
kromě #user=minidlna, což stejně přebíjí ta unita tam nic vražedně odlišnýho nevidím :-( Ještě to zkusím odkomentovat a změnit logování na info. Blbý je, že minidlna na Debianu 11 loguje do systemd, takže se to hrozně blbě tahá ven :-/
Max avatar 23.8.2021 18:21 Max | skóre: 72 | blog: Max_Devaine
Rozbalit Rozbalit vše Re: minidlna a indexování souborů
Ještě jedna věc, pokud ti projde reindexace v tom smyslu, že nové AV soubory minidlna zaregistruje, tak možná budeš mít v logách chyby ohledně nastavení kernelu. Doporučované je v případě minidlna mít nastaveno toto :
fs.inotify.max_user_watches=100000
Zdar Max
Měl jsem sen ... :(
pushkin avatar 23.8.2021 19:43 pushkin | skóre: 43 | blog: FluxBlog
Rozbalit Rozbalit vše Re: minidlna a indexování souborů
Hmm, to jsem pro jistotu už zvyšoval. Jinak zajímavé je, že když jsem odkomentoval uživatele v minidlna.conf, tak mi najednou minidlna začala logovat i do souboru :)

Ale vypadá to, že největší efekt mělo znovusestavení databáze, i když pořád jsou soubory, které minidlna prostě ignoruje, aniž by o nich cokoliv napsala do logu...
Max avatar 23.8.2021 20:31 Max | skóre: 72 | blog: Max_Devaine
Rozbalit Rozbalit vše Re: minidlna a indexování souborů
To se mi snad ještě nikdy nestalo, vždy zalogoval všechno. Dávno v minulosti, když jsem měl problém, tak reindexace byla vždy cesta, jak zjistit, v čem je problém. Může to být i v tom, že nežere název.
Taktéž se mi v nějaké době stávalo, že když mi to nezindexovalo soubor, tak jsem znovu vyvolal inotify tak, že jsem ho prostě přejmenoval a on se pak zanesl do indexu.
Zdar Max
Měl jsem sen ... :(
23.8.2021 12:36 j
Rozbalit Rozbalit vše Re: minidlna a indexování souborů
Odpovědět | | Sbalit | Link | Blokovat | Admin
Pridej si do crona force rescan (minidlnad -r). Tusim ze to i tak dela v nejakym intervalu, ale ten muze byt i par dnu.

A proc ti to nefunguje ...

"Inotify reports only events that a user-space program triggers through the filesystem API. As a result, it does not catch remote events that occur on network filesystems."

---

Dete s tim guuglem dopice!
pushkin avatar 23.8.2021 13:12 pushkin | skóre: 43 | blog: FluxBlog
Rozbalit Rozbalit vše Re: minidlna a indexování souborů
Ono je to všechno na lokálním disku. Jenom sdílím stejné adresáře přes Sambu i minidlna, takže tam můžu přes Sambu uploadnout soubory.
Max avatar 23.8.2021 16:18 Max | skóre: 72 | blog: Max_Devaine
Rozbalit Rozbalit vše Re: minidlna a indexování souborů
Špatně jsi to pochopil. Ten tučný text znamená, že by byl problém s tím, kdyby minidlna přistupovalo třeba na namapovaný nfs share, nebo na namapovaný smb share. To ale není případ tazatele, takže dělat nějaký pravidelný refresh databáze je nesmysl. V jeho případě bude fungovat inotify dobře.
Zdar Max
Měl jsem sen ... :(
24.8.2021 00:25 Michal Kubeček | skóre: 72 | Luštěnice
Rozbalit Rozbalit vše Re: minidlna a indexování souborů
Obávám se, že špatně jste to pochopil vy. Ten zvýrazněný text říká, že inotify nenahlásí změny, kteřé neprovedl userspace program ale driver síťového filesystému. A tazatel píše: "Pokud je uložím jinak (typicky přes sambu…", tj. popisuje přesně tuhle situaci. Otázka je jen, jak je to s tím NTFS, tam by možná mohl být problém v tom, jak se vůči inotify chová FUSE.
Max avatar 24.8.2021 09:15 Max | skóre: 72 | blog: Max_Devaine
Rozbalit Rozbalit vše Re: minidlna a indexování souborů
Jenomže když to nahrává přes sambu, tak se nepoužívá nějaký "síťový" driver, ale samba to uloží lokálně a inotify zafunguje. "Síťový" driver by se použil, kdyby ta sbírka AV byla namapována do minidlna serveru přes smb, nebo nfs apod. To ale není případ tazatele a není to ani můj případ. Já i tazatel máme nainstalovaný minidlna a sambu na stejném serveru a z win klientů se tam kopírují AV. A inotify normálně funguje a problém s tím není.
Zdar Max
Měl jsem sen ... :(
pushkin avatar 24.8.2021 12:55 pushkin | skóre: 43 | blog: FluxBlog
Rozbalit Rozbalit vše Re: minidlna a indexování souborů
Přesně tak.
24.8.2021 16:55 Michal Kubeček | skóre: 72 | Luštěnice
Rozbalit Rozbalit vše Re: minidlna a indexování souborů
Jasně, naštěstí už CIFS skoro nepoužívám, tak jsem si neuvědomil, že serverová strana je implementovaná jako userspace démon.

Založit nové vláknoNahoru

Tiskni Sdílej: Linkuj Jaggni to Vybrali.sme.sk Google Del.icio.us Facebook

ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.