› Foros › PC › Software libre
# 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.
# 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)
media_dir=A, /home/gato/KTorrenT/
media_dir=P, /home/gato/KTorrenT/
media_dir=V, /home/gato/KTorrenT/
#
# 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
# Path to the directory that should hold the database and album art cache.
db_dir=/var/lib/minidlna
# Path to the directory that should hold the log file.
log_dir=/var/log
# 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=.
# Network interface(s) to bind to (e.g. eth0), comma delimited.
network_interface=eth1
# 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=GaTo
# 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 - esta linea no funciona
minissdpdsocket=/var/run/minissdpd.sock
#!/bin/sh
#
# MiniDLNA initscript
#
# Based on the mediatomb debian package.
# Original authors: Tor Krill <tor@excito.com>
# Leonhard Wimmer <leo@mediatomb.cc>
# Andres Mejia <mcitadel@gmail.com>
#
# Modified by: Benoît Knecht <benoit.knecht@fsfe.org>
#
### BEGIN INIT INFO
# Provides: minidlna
# Required-Start: $network $local_fs $remote_fs
# Required-Stop:: $network $local_fs $remote_fs
# Should-Start: $all
# Should-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start minidlna at boot time
# Description: Manage the minidlna daemon, a DLNA/UPnP-AV media server.
### END INIT INFO
unset USER
# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="DLNA/UPnP-AV media server"
NAME=minidlna
DAEMON=/usr/bin/minidlna
PIDDIR=/run/$NAME
PIDFILE=$PIDDIR/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
DEFAULT=/etc/default/$NAME
# Exit if the package is not installed
[ -x $DAEMON ] || exit 0
# Read configuration variable file if it is present
[ -r $DEFAULT ] && . $DEFAULT
# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions
# Do not start the daemon if NO_START is enabled in DEFAULT
if [ "$START_DAEMON" != "yes" ] && [ "$1" != "stop" ]; then
log_warning_msg "$NAME: Not starting $DESC."
log_warning_msg "$NAME: Disabled in $DEFAULT."
exit 0
fi
# Set the default configuration file
if [ -z $CONFIGFILE ]; then
CONFIGFILE=/etc/minidlna.conf
fi
# Set the default log file
if [ -z $LOGFILE ]; then
LOGFILE=/var/log/minidlna.log
fi
# Run as `minidlna' if USER is not specified or is `root'
if [ -z $USER ]; then
USER=minidlna
fi
# If no group is specified, use USER
if [ -z $GROUP ]; then
GROUP=$USER
fi
DAEMON_ARGS="-f $CONFIGFILE -P $PIDFILE $DAEMON_OPTS"
#
# Function that starts the daemon/service
#
do_start()
{
# Return
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
touch $LOGFILE && chown $USER:$GROUP $LOGFILE || return 2
if [ ! -d $PIDDIR ]; then
mkdir $PIDDIR || return 2
fi
chown $USER:$GROUP $PIDDIR || return 2
start-stop-daemon --start --quiet --pidfile $PIDFILE \
--chuid $USER:$GROUP --exec $DAEMON --test > /dev/null \
|| return 1
start-stop-daemon --start --quiet --pidfile $PIDFILE \
--chuid $USER:$GROUP --exec $DAEMON -- \
$DAEMON_ARGS \
|| return 2
}
#
# Function that stops the daemon/service
#
do_stop()
{
# Return
# 0 if daemon has been stopped
# 1 if daemon was already stopped
# 2 if daemon could not be stopped
# other if a failure occurred
sleep 5
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
RETVAL="$?"
[ "$RETVAL" = 2 ] && return 2
# Wait for children to finish too if this is a daemon that forks
# and if the daemon is only ever run from this initscript.
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
[ "$?" = 2 ] && return 2
# Many daemons don't delete their pidfiles when they exit.
rm -rf $PIDDIR
return "$RETVAL"
}
case "$1" in
start)
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME"
do_start
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
stop)
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
do_stop
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
status)
status_of_proc -p "$PIDFILE" "$DAEMON" "$NAME" && exit 0 || exit $?
;;
restart|force-reload)
log_daemon_msg "Restarting $DESC" "$NAME"
do_stop
case "$?" in
0|1)
if [ "$1" = "force-reload" ]; then
# Rescan the collection
DAEMON_ARGS="$DAEMON_ARGS -R"
fi
do_start
case "$?" in
0) log_end_msg 0 ;;
1) log_end_msg 1 ;; # Old process is still running
*) log_end_msg 1 ;; # Failed to start
esac
;;
*)
# Failed to stop
log_end_msg 1
;;
esac
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
exit 3
;;
esac
: