2015/02/28 12:48:03] minidlna.c:1014: warn: Starting MiniDLNA version 1.1.3.Para resolver esto, he creado un pequeño script, que podemos añadir en nuestro rc.local o en el crontab, o simplemente, lanzarlo manualmente a través de consola.
[2015/02/28 12:48:03] minidlna.c:1053: warn: HTTP listening on port 8200
[2015/02/28 12:48:14] minidlna.c:929: error: MiniDLNA is already running. EXITING
[2015/02/28 12:48:19] minidlna.c:929: error: MiniDLNA is already running. EXITING.
[2015/02/28 12:48:20] minidlna.c:929: error: MiniDLNA is already running. EXITING.
El código, elimina el proceso de minidlna, comprueba en la configuración donde reside la base de datos, la elimina y arranca el servicio:
actualizardb.sh
#!/bin/shCrea el fichero en /lib
# Script para actualizar Minidlna
# Barrier Breaker 14.07
kill -9 $(pgrep minidlna)
sleep 5
unidad=$(cat /etc/config/minidlna | grep "option db_dir" | awk {' print $3 }' | sed {'s/'\''//g'})
rm $unidad"/files.db"
sleep 10
/etc/init.d/minidlna start
# nano /lib/actualizardb.shUna vez creado asignamos permisionados:
# chmod 755 /lib/actualizardb.shY ahora o lo lanzas manualmente, o lo incluyes en rc.local o crontab:
# ./lib/actualizardb.shComprueba que está funcionando correctamente, mirando en el log:
# cat /var/log/minidlna.log
[2015/02/28 13:05:09] minidlna.c:1053: warn: HTTP listening on port 8200Se puede comprobar que cada vez que lanzamos el script, nos recrea la base de datos.
[2015/02/28 13:05:09] scanner.c:706: warn: Scanning /mnt/usb01
[2015/02/28 13:05:19] scanner.c:793: warn: Scanning /mnt/usb01 finished (32 files)!
[2015/02/28 13:05:19] playlist.c:125: warn: Parsing playlists...
[2015/02/28 13:05:19] playlist.c:259: warn: Finished parsing playlists.
[2015/02/28 13:05:54] minidlna.c:1014: warn: Starting MiniDLNA version 1.1.3.
[2015/02/28 13:05:55] minidlna.c:355: warn: Creating new database at /mnt/usb01/db/files.db
[2015/02/28 13:05:55] minidlna.c:1053: warn: HTTP listening on port 8200
[2015/02/28 13:05:55] scanner.c:706: warn: Scanning /mnt/usb01
[2015/02/28 13:06:05] scanner.c:793: warn: Scanning /mnt/usb01 finished (32 files)!
[2015/02/28 13:06:05] playlist.c:125: warn: Parsing playlists...
[2015/02/28 13:06:05] playlist.c:259: warn: Finished parsing playlists.
Actualización 6/03/2015
He recibido algunas consultas por mail, en las cuales me plantean el evidente engorro de tener que acceder a través de putty e inicializar la base de datos, cada vez que se inserta el disco duro con los contenidos multimedia.
Por ello os sugiero una solución, en la que cada vez que insertemos el dispositivo nos ejecute el anterior script, para ello tenéis que editar el fichero /etc/hotplug.d/usb/20-usb_mode y poner las líneas siguientes:
#!/bin/sh
/etc/init.d/usbmode start
./lib/actualizardb.sh
Una vez grabado, podéis comprobar si funciona:
# tail -f /var/log/minidlna.logExtraer e insertar el dispositivo USB, y podréis ver algo así:
[2015/03/06 18:31:08] minidlna.c:1053: warn: HTTP listening on port 8200
[2015/03/06 18:31:08] getifaddr.c:109: error: Network interface wlan0 not found
[2015/03/06 18:31:23] minidlna.c:1014: warn: Starting MiniDLNA version 1.1.3.
[2015/03/06 18:31:23] minidlna.c:355: warn: Creating new database at /tmp/run/minidlna/files.db
[2015/03/06 18:31:24] minidlna.c:1053: warn: HTTP listening on port 8200
[2015/03/06 18:31:24] getifaddr.c:109: error: Network interface wlan0 not found
[2015/03/06 18:31:24] scanner.c:706: warn: Scanning /mnt/HD
[2015/03/06 18:31:24] scanner.c:793: warn: Scanning /mnt/HD finished (2 files)!
[2015/03/06 18:31:24] playlist.c:125: warn: Parsing playlists...
[2015/03/06 18:31:24] playlist.c:259: warn: Finished parsing playlists.
[2015/03/06 18:41:41] minidlna.c:1014: warn: Starting MiniDLNA version 1.1.3.
[2015/03/06 18:41:41] minidlna.c:355: warn: Creating new database at /tmp/run/minidlna/files.db
[2015/03/06 18:41:42] minidlna.c:1053: warn: HTTP listening on port 8200
[2015/03/06 18:41:42] getifaddr.c:109: error: Network interface wlan0 not found
[2015/03/06 18:41:57] minidlna.c:1014: warn: Starting MiniDLNA version 1.1.3.
[2015/03/06 18:41:57] minidlna.c:355: warn: Creating new database at /tmp/run/minidlna/files.db
[2015/03/06 18:42:13] minidlna.c:1014: warn: Starting MiniDLNA version 1.1.3.
[2015/03/06 18:42:13] minidlna.c:355: warn: Creating new database at /tmp/run/minidlna/files.db
[2015/03/06 18:42:14] minidlna.c:1053: warn: HTTP listening on port 8200
[2015/03/06 18:42:14] getifaddr.c:109: error: Network interface wlan0 not found
[2015/03/06 18:42:29] minidlna.c:1014: warn: Starting MiniDLNA version 1.1.3.
[2015/03/06 18:42:29] minidlna.c:355: warn: Creating new database at /tmp/run/minidlna/files.db
[2015/03/06 18:42:30] minidlna.c:1053: warn: HTTP listening on port 8200
[2015/03/06 18:42:30] getifaddr.c:109: error: Network interface wlan0 not found
[2015/03/06 18:42:30] scanner.c:706: warn: Scanning /mnt/HD
[2015/03/06 18:42:30] scanner.c:793: warn: Scanning /mnt/HD finished (2 files)!
[2015/03/06 18:42:30] playlist.c:125: warn: Parsing playlists...
[2015/03/06 18:42:30] playlist.c:259: warn: Finished parsing playlists.
Espero os sirva de ayuda.
No hay comentarios:
Publicar un comentario