You are not logged in.

#1 2017-06-04 11:08:03

Haroon
Member
From: Germany
Registered: 2017-02-14
Posts: 24

minidlna service can't get access to ~, even with override.conf

Hello, I can't seem to get minidlna to work properly.
I tried running it as myuser, as root and as minidlna, but nothing seems to let the service start properly and allow acces to the directories.

This is how everything looks, after my latest attemt to get it to run.

$ systemctl status minidlna.service
● minidlna.service - minidlna server
   Loaded: loaded (/usr/lib/systemd/system/minidlna.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Sun 2017-06-04 12:57:16 CEST; 2min 44s ago
  Process: 669 ExecStart=/usr/bin/minidlnad -S (code=exited, status=255)
 Main PID: 669 (code=exited, status=255)

Jun 04 12:57:16 i7_2600 systemd[1]: Started minidlna server.
Jun 04 12:57:16 i7_2600 minidlnad[669]: [2017/06/04 12:57:16] minidlna.c:607: error: Media directory "/home/haroon/Downloads/" not accessible [Permission denied]
Jun 04 12:57:16 i7_2600 minidlnad[669]: [2017/06/04 12:57:16] utils.c:293: warn: make_dir: cannot create directory '/home/haroon/'
Jun 04 12:57:16 i7_2600 minidlnad[669]: [2017/06/04 12:57:16] minidlna.c:660: fatal: Log path not accessible! [/home/haroon/Logs/]
Jun 04 12:57:16 i7_2600 systemd[1]: minidlna.service: Main process exited, code=exited, status=255/n/a
Jun 04 12:57:16 i7_2600 systemd[1]: minidlna.service: Unit entered failed state.
Jun 04 12:57:16 i7_2600 systemd[1]: minidlna.service: Failed with result 'exit-code'.
$ cat /etc/default/minidlna 
# User and group the shoudl run as
USER="root"
#GROUP="minidlna"
$ cat /etc/minidlna.conf 
# port for HTTP (descriptions, SOAP, media transfer) traffic
port=8200

# network interfaces to serve, comma delimited
#network_interface=eth0

# specify the user account name or uid to run as
user=root

# set this to the directory you want scanned.
# * if you want multiple directories, you can have multiple media_dir= lines
# * if you want to restrict a media_dir to specific content types, you
#   can prepend the types, followed by a comma, to the directory:
#   + "A" for audio  (eg. media_dir=A,/home/jmaggard/Music)
#   + "V" for video  (eg. media_dir=V,/home/jmaggard/Videos)
#   + "P" for images (eg. media_dir=P,/home/jmaggard/Pictures)
#   + "PV" for pictures and video (eg. media_dir=PV,/home/jmaggard/digital_camera)
media_dir=/home/haroon/Downloads/

# set this to merge all media_dir base contents into the root container
# note: the default is no
#merge_media_dirs=no

# set this if you want to customize the name that shows up on your clients
friendly_name=DLNA_Haroon

# set this if you would like to specify the directory where you want MiniDLNA to store its database and album art cache
#db_dir=/var/cache/minidlna

# set this if you would like to specify the directory where you want MiniDLNA to store its log file
log_dir=/home/haroon/Logs/

# set this to change the verbosity of the information that is logged
# each section can use a different level: off, fatal, error, warn, info, or debug
#log_level=general,artwork,database,inotify,scanner,metadata,http,ssdp,tivo=warn

# this should be a list of file names to check for when searching for album art
# note: 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

# set this to no to disable inotify monitoring to automatically discover new files
# note: the default is yes
inotify=yes

# set this to yes to enable support for streaming .jpg and .mp3 files to a TiVo supporting HMO
enable_tivo=no

# set this to beacon to use legacy broadcast discovery method
# defauts to bonjour if avahi is available
tivo_discovery=bonjour

# set this to strictly adhere to DLNA standards.
# * This will allow server-side downscaling of very large JPEG images,
#   which may hurt JPEG serving performance on (at least) Sony DLNA products.
strict_dlna=no

# default presentation url is http address on port 80
#presentation_url=http://www.mylan/index.php

# notify interval in seconds. default is 895 seconds.
notify_interval=900

# serial and model number the daemon will report to clients
# in its XML description
serial=12345678
model_number=1

# specify the path to the MiniSSDPd socket
#minissdpdsocket=/var/run/minissdpd.sock

# use different container as root of the tree
# possible values:
#   + "." - use standard container (this is the default)
#   + "B" - "Browse Directory"
#   + "M" - "Music"
#   + "V" - "Video"
#   + "P" - "Pictures"
#   + Or, you can specify the ObjectID of your desired root container (eg. 1$F for Music/Playlists)
# if you specify "B" and client device is audio-only then "Music/Folders" will be used as root
#root_container=.

# always force SortCriteria to this value, regardless of the SortCriteria passed by the client
#force_sort_criteria=+upnp:class,+upnp:originalTrackNumber,+dc:title

# 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

Thanks for any advice you can offer.

Last edited by Haroon (2017-06-05 12:29:13)

Offline

#2 2017-06-04 11:21:46

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,650

Re: minidlna service can't get access to ~, even with override.conf

Don't run it as root in any case, and read https://wiki.archlinux.org/index.php/Re … accessible

Offline

#3 2017-06-04 13:22:54

Haroon
Member
From: Germany
Registered: 2017-02-14
Posts: 24

Re: minidlna service can't get access to ~, even with override.conf

Thanks for the suggestion, I don't know why I didn't see it. I tried it but It doesn't seem to work.
I tried /etc/minidlna.conf with user=minidlna and user=haroon.

$ cat /etc/minidlna.conf 
# port for HTTP (descriptions, SOAP, media transfer) traffic
port=8200

# network interfaces to serve, comma delimited
#network_interface=eth0

# specify the user account name or uid to run as
user=haroon

# set this to the directory you want scanned.
# * if you want multiple directories, you can have multiple media_dir= lines
# * if you want to restrict a media_dir to specific content types, you
#   can prepend the types, followed by a comma, to the directory:
#   + "A" for audio  (eg. media_dir=A,/home/jmaggard/Music)
#   + "V" for video  (eg. media_dir=V,/home/jmaggard/Videos)
#   + "P" for images (eg. media_dir=P,/home/jmaggard/Pictures)
#   + "PV" for pictures and video (eg. media_dir=PV,/home/jmaggard/digital_camera)
media_dir=/home/haroon/Downloads/

# set this to merge all media_dir base contents into the root container
# note: the default is no
#merge_media_dirs=no

# set this if you want to customize the name that shows up on your clients
friendly_name=DLNA_Haroon

# set this if you would like to specify the directory where you want MiniDLNA to store its database and album art cache
#db_dir=/var/cache/minidlna

# set this if you would like to specify the directory where you want MiniDLNA to store its log file
log_dir=/home/haroon/Logs/

# set this to change the verbosity of the information that is logged
# each section can use a different level: off, fatal, error, warn, info, or debug
#log_level=general,artwork,database,inotify,scanner,metadata,http,ssdp,tivo=warn

# this should be a list of file names to check for when searching for album art
# note: 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

# set this to no to disable inotify monitoring to automatically discover new files
# note: the default is yes
inotify=yes

# set this to yes to enable support for streaming .jpg and .mp3 files to a TiVo supporting HMO
enable_tivo=no

# set this to beacon to use legacy broadcast discovery method
# defauts to bonjour if avahi is available
tivo_discovery=bonjour

# set this to strictly adhere to DLNA standards.
# * This will allow server-side downscaling of very large JPEG images,
#   which may hurt JPEG serving performance on (at least) Sony DLNA products.
strict_dlna=no

# default presentation url is http address on port 80
#presentation_url=http://www.mylan/index.php

# notify interval in seconds. default is 895 seconds.
notify_interval=900

# serial and model number the daemon will report to clients
# in its XML description
serial=12345678
model_number=1

# specify the path to the MiniSSDPd socket
#minissdpdsocket=/var/run/minissdpd.sock

# use different container as root of the tree
# possible values:
#   + "." - use standard container (this is the default)
#   + "B" - "Browse Directory"
#   + "M" - "Music"
#   + "V" - "Video"
#   + "P" - "Pictures"
#   + Or, you can specify the ObjectID of your desired root container (eg. 1$F for Music/Playlists)
# if you specify "B" and client device is audio-only then "Music/Folders" will be used as root
#root_container=.

# always force SortCriteria to this value, regardless of the SortCriteria passed by the client
#force_sort_criteria=+upnp:class,+upnp:originalTrackNumber,+dc:title

# 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
$ sudo systemctl status minidlna.service
● minidlna.service - minidlna server
   Loaded: loaded (/usr/lib/systemd/system/minidlna.service; disabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/minidlna.service.d
           └─override.conf
   Active: failed (Result: exit-code) since Sun 2017-06-04 15:14:13 CEST; 2min 19s ago
  Process: 663 ExecStart=/usr/bin/minidlnad -S (code=exited, status=255)
 Main PID: 663 (code=exited, status=255)

Jun 04 15:14:13 i7_2600 systemd[1]: Started minidlna server.
Jun 04 15:14:13 i7_2600 minidlnad[663]: [2017/06/04 15:14:13] minidlna.c:607: error: Media directory "/home/haroon/Downloads/" not accessible [Permission deni
Jun 04 15:14:13 i7_2600 minidlnad[663]: [2017/06/04 15:14:13] utils.c:293: warn: make_dir: cannot create directory '/home/haroon/Logs/'
Jun 04 15:14:13 i7_2600 minidlnad[663]: [2017/06/04 15:14:13] minidlna.c:660: fatal: Log path not accessible! [/home/haroon/Logs/]
Jun 04 15:14:13 i7_2600 systemd[1]: minidlna.service: Main process exited, code=exited, status=255/n/a
Jun 04 15:14:13 i7_2600 systemd[1]: minidlna.service: Unit entered failed state.
Jun 04 15:14:13 i7_2600 systemd[1]: minidlna.service: Failed with result 'exit-code'.
$ cat /etc/systemd/system/minidlna.service.d/override.conf 
[Service]
ProtectHome=read-only
$ ls -lha /home/haroon/
total 4.4G
drwx--x---+ 20 haroon haroon 4.0K Jun  4 15:13  .
drwxr-xr-x   5 root   root   4.0K May 18 21:44  ..
-rw-------   1 haroon haroon  17K Jun  4 15:13  .bash_history
-rw-r--r--   1 haroon haroon   21 Feb 14 14:16  .bash_logout
-rw-r--r--   1 haroon haroon   57 Feb 14 14:16  .bash_profile
-rw-r--r--   1 haroon haroon  141 Feb 14 14:16  .bashrc
drwxr-xr-x  14 haroon haroon 4.0K May 28 19:47  .cache
drwxr-xr-x  21 haroon haroon 4.0K Jun  3 21:09  .config
drwxr-xr-x   2 haroon haroon 4.0K Jun  3 21:09  Desktop
drwxr-xr-x   9 haroon haroon 4.0K Jun  3 20:29  Downloads
-rw-------   1 haroon haroon   16 May  7 17:21  .esd_auth
-rwxr-xr-x   1 root   root   8.8M May  6 10:58  FF7.png
drwx------   3 haroon haroon 4.0K May  6 10:42  .gnupg
-rw-------   1 haroon haroon  13K Jun  4 15:13  .ICEauthority
-rwxrwxrwx   1 haroon haroon  187 May  7 13:09  IOMMU.Groups
-rw-r--r--   1 haroon haroon 2.4K May  7 13:10  IOMMU.Output
drwxr-xr-x   3 haroon haroon 4.0K May  6 10:41  .local
drwxr-xr-x   2 haroon haroon 4.0K Jun  4 12:12  Logs
drwxr-xr-x   2 haroon haroon 4.0K May  6 20:09  .mplayer
-rw-r--r--   1 haroon haroon 110M May 14 09:05  nier-lossy-vs-lossless-sample.zip
drwxr-xr-x   3 haroon haroon 4.0K May 23 20:39  .openoffice
drwx------   3 haroon haroon 4.0K May 17 20:03  .pki
drwx------   2 haroon haroon 4.0K May 27 14:17  .ssh
-rw-r--r--   1 haroon haroon 667K May  7 18:57  synergy-1.5.0-2-x86_64.pkg.tar.xz
drwx------   2 haroon haroon 4.0K Jun  2 14:49 '.TeamSpeak 3'
-rwxrwxrwx   1 haroon haroon   32 May 14 08:40  test.sh
drwxr-xr-x   3 haroon haroon 4.0K May  7 11:15  .thumbnails
drwxr-xr-x   6 haroon haroon 4.0K Jun  3 00:39  .ts3client
drwxr-xr-x   2 haroon haroon 4.0K May  7 14:19  .uml
drwxr-xr-x   2 haroon haroon 4.0K May  6 10:56  usb
drwxr-xr-x   2 haroon haroon 4.0K May 27 14:33  usb2
-rw-------   1 haroon haroon 2.8K Jun  4 12:48  .viminfo
-rw-r--r--   1 haroon kvm    163M May  7 20:58  virtio-win-0.1.136.iso
drwxr-xr-x   2 haroon haroon 4.0K May 12 21:12  VM
-rw-r--r--   1 haroon kvm    4.1G May  7 15:21  Win10_1703_English_x64.iso
-rw-------   1 haroon haroon   52 Jun  4 15:13  .Xauthority
-rw-r--r--   1 haroon haroon  22K Jun  4 15:14  .xfce4-session.verbose-log
-rw-r--r--   1 haroon haroon  22K Jun  4 15:09  .xfce4-session.verbose-log.last
-rw-r--r--   1 haroon haroon 6.9K May  7 10:28  xrandr.output
-rw-------   1 haroon haroon    0 Jun  4 15:13  .xsession-errors

Offline

Board footer

Powered by FluxBB