Page 1 of 3

[HOWTO] Install minidlna into a jail

Posted: 20 Dec 2012 09:25
by raulfg3
Minidlna is a light and good replacement for actual upnp server fuppes included on Nas4Free that do not work (December 2012), and have a not actualized page: http://fuppes.ulrich-voelkel.de/ since April 2012. -> Perhaps this change in the future, but now minidlna is the first recomendation to sustitute/replace fuppes.

This install is valid for embeded & full install, and is not affected by Nas4Free upgrades, because jails resides on data disk.

1 : prerequisites: You need a working jail, you can use wiki to create one = : http://wiki.nas4free.org/doku.php?id=do ... owto:jails
links: http://linux-bsd-sharing.blogspot.com.e ... na-on.html

Or use TheBrig and create a new jail named minidlna: viewtopic.php?f=79&t=3894 ( change proto by minidlna in all next examples)

This howto use the default proto jail in the commands and examples, but you need to change "proto" by your jail name ( I rename my jail proto to minidlna later to know what are inside, usefull if you have more that one jail).

OK, first you need to edit fstab.proto to add your Video, Photos and Audio paths:

edit fstab.proto to define what mount

Code: Select all

nano /jail/conf/fstab.proto
this is my case of example, yours could be diferent:

Code: Select all

/mnt/NAS-A/Video /jail/proto/mnt/Video nullfs ro 0 0
/mnt/NAS-A/Musica /jail/proto/mnt/Musica nullfs ro 0 0
/mnt/NAS-A/Fotos /jail/proto/mnt/Fotos nullfs ro 0 0
Remember to change proto for your jail name

probably you need first time to create mount folders inside the jail, so you need to execute:

Code: Select all

mkdir /jail/proto/mnt/{Video,Musica,Fotos}


or you can use TheBrig the new jail manager for home users: viewtopic.php?f=79&t=3894&p=20142#p20135



At this point you need to reboot your NAS to start jails with desired mounts ( previosly defined mount points).

once done check that your jail is running and what jail number have:

Code: Select all

rnas:~# jls
   JID  IP Address      Hostname                      Path
     1  192.168.1.201   proto                         /jail/proto
     2  192.168.1.202   upnp                          /jail/upnp
rnas:~#
enter into the jail (in my case 1, your could be diferent):

Code: Select all

rnas:~# jexec 1 csh
You have mail.
root@proto:/ #

if your Nas4Free is in RC state , you need to define path to packages (latest Nas4Free are 9.1 release and do not need this line):

Code: Select all

setenv PACKAGESITE ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-current/Latest/
now you can install minidlna:

Code: Select all

pkg_add -r minidlna
When done, you need to configure minidlna

Code: Select all

ee /usr/local/etc/minidlna.conf
This is my minidlna.conf if you want to check my config:

Code: Select all

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

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

# set this to the directory you want scanned.
# * if have multiple directories, you can have multiple media_dir= lines
# * if you want to restrict a media_dir to a specific content type, you
#   can prepend the type, 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)
media_dir=V,/mnt/Video  # this line must be compatible with lines done in fstab.proto whitout /jail/proto part

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

# 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/db/minidlna #  perhaps you need to create folder minidlna first time

# set this if you would like to specify the directory where you want MiniDLNA to store its log file
log_dir=/var/db/minidlna

# 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=no

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

# 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  # default value
notify_interval=10    # change to 10 second to bypass the multicast problem of jails (or at least minimize problem)


# 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"
# if you specify "B" and client device is audio-only then "Music/Folders" will be used as root
#root_container=B
create needed folders

Code: Select all

mkdir /var/db/minidlna
UPDATE: create user (first time dlna user/group exist, but when reboot dissapear, use this to solve):

Code: Select all

pw groupadd dlna -g 933
pw useradd dlna -g dlna -u 933 -s /bin/sh -c "dlna Daemon" -d /var/db/minidlna
take control of new folder:

Code: Select all

chown dlna:dlna /var/db/minidlna
edit rc.conf to autostart minidlna:

Code: Select all

ee /etc/rc.conf
add "minidlna_enable="YES" "

Code: Select all

minidlna_enable=yes 
note: you can use :

Code: Select all

echo minidlna_enable="YES" >> /etc/rc.conf
instead of edit file
[/b]

edit /usr/local/etc/rc.d/minidlna only if your NF4 is 9.0 or older , if is BSD 9.1 or never, you do not need to edit file

Code: Select all

ee /usr/local/etc/rc.d/minidlna


copy & paste this script:

Code: Select all

#!/bin/sh

# $FreeBSD: ports/net/minidlna/files/minidlna.sh.in,v 1.5 2012/05/08 02:31:27 mi Exp $
#
# PROVIDE: minidlna
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following line to /etc/rc.conf[.local] to enable minidlna:
#
# minidlna_enable="YES"

. /etc/rc.subr

name=minidlna
rcvar=minidlna_enable
command=/usr/local/sbin/minidlna

load_rc_config $name

minidlna_enable=${minidlna_enable-"NO"}
minidlna_uid=${minidlna_uid-"dlna"}

pidfile="/var/db/minidlna/minidlna.pid"

start_precmd="rm -f $pidfile"
stop_postcmd=$start_precmd

command_args="-P $pidfile -u $minidlna_uid"
extra_commands=rescan
rescan_cmd="$command -R -u $minidlna_uid"
required_dirs="/var/db/minidlna"

run_rc_command $1
now you can test that minidlna start, type in shell:

Code: Select all

/usr/local/etc/rc.d/minidlna start
you can test that works conecting to minidlna webGUI 192.168.1.201:8200 in my case , if works, show how many files has detected/indexed.
minidlna status.jpg
NOTE: I notice that multicast do not work well on jails, this is notice in minidlna adding a long, long time to be detected on upnp renders, but once detected, normally works flawshely and without problems.

To minimize problem try in minidlna.conf :
# notify interval in seconds. default is 895 seconds.
#notify_interval=900 # default value
notify_interval=10 # change to 10 second to bypass the multicast problem of jails (or at least minimize problem)

Re: [HOWTO] Install minidlna into a jail (WIP)

Posted: 20 Dec 2012 09:32
by raulfg3
using misterredman suggest I configure cron to rescan minidlna every day at 02:00 AM.

this is my crontab:

Code: Select all

root@minidlna:/ # crontab -l
    SHELL=/bin/sh
    PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
    HOME=/var/log
    #
    #minute  hour  mday  month  wday  command
    #
    0     2     *     *      *     /usr/local/etc/rc.d/minidlna rescan
    #
root@minidlna:/ #
I edit using ee as editor

Code: Select all

setenv EDITOR ee
and edit crontab with

Code: Select all

crontab -e

Trick : if you do not want to wait until time select by cron and want to execute a rescan inmediately, you only need to exec from Advanced|Execute command:

Code: Select all

jexec 2 /usr/local/etc/rc.d/minidlna rescan
keep in mind that 2 is your jail number (if you have other jail number you must use instead)
[/size][/b]
execute.jpg



----------------------------------------------------------------------------------------------------------------------

Now How to add minidlna.log to Nas4Free log:

You can add minidlna.log to Nas4Free logs, I do the work using notes from: http://masterut.blogspot.com.es/2011/12 ... -dlna.html

First you need to edit file /usr/local/www/diag_log.inc use Advanced|File Editor to locate and load , so is ready to edit.

locate fuppes lines:

Code: Select all

$fuppes_logfile = rc_getenv_ex("fuppes_logfile", "{$g['varlog_path']}/fuppes.log");
copy & paste & edit fuppes to minidlna like this:

Code: Select all

$fuppes_logfile = rc_getenv_ex("fuppes_logfile", "{$g['varlog_path']}/fuppes.log");
$minidlna_logfile = rc_getenv_ex("minidlna_logfile", "{$g['varlog_path']}/minidlna.log");

Find next fuppes section:

Code: Select all

array(
		"visible" => TRUE,
		"desc" => gettext("fuppes"),
		"logfile" => $fuppes_logfile,
		"filename" => "fuppes.log",
		"type" => "plain",
		"pattern" => "/^(.*)$/",
		"columns" => array(
			array("title" => gettext("Event"), "class" => "listlr", "param" => "", "pmid" => 1)
		)),

Do the same , copy & paste and edit copy to sustitute fuppes by minidlna

Code: Select all

array(
		"visible" => TRUE,
		"desc" => gettext("DLNA"),
		"logfile" => $fuppes_logfile,
		"filename" => "fuppes.log",
		"type" => "plain",
		"pattern" => "/^(.*)$/",
		"columns" => array(
			array("title" => gettext("Event"), "class" => "listlr", "param" => "", "pmid" => 1)
		)),
array(
		"visible" => TRUE,
		"desc" => gettext("minidlna"),
		"logfile" => $minidlna_logfile,
		"filename" => "minidlna.log",
		"type" => "plain",
		"pattern" => "/^(.*)$/",
		"columns" => array(
			array("title" => gettext("Event"), "class" => "listlr", "param" => "", "pmid" => 1)
		)),
in system | advanced | rc.conf add a new variable named minidlna_log and use as value path to your jail log:
minidlna rc.conf.jpg

save and test, go to Diagnostics|Log and select the new minidlna log.

you can see:
Image

and


PD: my original and modified diag_log.inc for comparation purpouses:
diag_log.zip

Re: [HOWTO] Install minidlna into a jail (WIP)

Posted: 20 Dec 2012 12:21
by misterredman
To add a cron job

I use the following command to change the default editor for the crontab file to nano instead of vi.:

Code: Select all

setenv EDITOR nano
nano must of course be installed. You can replace nano with your preferred editor or leave it as is if you like vi. The change will revert when you logout.

To confirm it was accepted:

Code: Select all

setenv


To edit the crontab file for the current user (if you are root it will edit the root user crontab):

Code: Select all

crontab -e
Here is an example of a user crontab file:

Code: Select all

SHELL=/bin/sh
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
HOME=/var/log
#
#minute  hour  mday  month  wday  command
#
*/20     *     *     *      *     yourcommandhere
#
*/5      *     *     *      *     anothercommandhere
"yourcommandhere" will run every 20 minutes.
"anothercommandhere" will run every 5 minutes.

After saving the file and exiting the editor, crontab will automatically detect a change and reload the crontab file.

It's a good idea to give the full path to the commands.

If you look for example crontab files on the net beware that there are differences between the users crontab and the system crontab file formats. System crontab all specify the user the command will be run as (so there will be an additional column with the usernames).

If someone has corrections or a better way to do it please post it here.

link: http://www.freebsd.org/doc/handbook/con ... -cron.html

Re: [HOWTO] Install minidlna into a jail (WIP)

Posted: 28 Dec 2012 02:09
by DanAddz
When do you recommend me creating this Dir? I am going to start this process again as I'm only testing my nas at the moment. Do you need to have some videos on your nas first? If so where do you recommend putting them to Make this work??

Cheers

Note: have you got shares in your data share called video etc

So mnt/data/video etc?

Re: [HOWTO] Install minidlna into a jail (WIP)

Posted: 28 Dec 2012 09:43
by raulfg3
Yes but not in data, in my case my pool is named NAS-A
/mnt/NAS-A/Video /jail/proto/mnt/Video nullfs ro 0 0
/mnt/NAS-A/Musica /jail/proto/mnt/Musica nullfs ro 0 0
/mnt/NAS-A/Fotos /jail/proto/mnt/Fotos nullfs ro 0 0

Re: [HOWTO] Install minidlna into a jail (WIP)

Posted: 28 Dec 2012 10:01
by DanAddz
So before you put this in

Code: Select all

/mnt/NAS-A/Video /jail/proto/mnt/Video nullfs ro 0 0
/mnt/NAS-A/Musica /jail/proto/mnt/Musica nullfs ro 0 0
/mnt/NAS-A/Fotos /jail/proto/mnt/Fotos nullfs ro 0 0
Did you create the mnt/NAS-A/Video first???

Meaning that the video file was created before installing minidlna?

Cheers

Re: [HOWTO] Install minidlna into a jail (WIP)

Posted: 28 Dec 2012 21:08
by raulfg3
/mnt/NAS-A is my default pool , that i use to share by SMB, i have a lot of vĂ­deos prior to create the Jail, so i use fstab.proto to mount my video files in read only mode inside of the jail

Re: [HOWTO] Install minidlna into a jail (WIP)

Posted: 30 Dec 2012 10:05
by dodger
Is there a way of removing Minidlna from inside a Jail?

What do i need to delete? Thinking of starting the installation again from scratch.

Re: [HOWTO] Install minidlna into a jail (WIP)

Posted: 30 Dec 2012 23:06
by raulfg3
read last part of wiki, How to delete a jail: http://wiki.nas4free.org/doku.php?id=do ... owto:jails

deleting jail.jpg

Re: [HOWTO] Install minidlna into a jail (WIP)

Posted: 02 Jan 2013 15:57
by raulfg3
DanAddz wrote:Hay Guys,

Sorry for so many questions,

I am completing this on my nas4free and am having some trouble again.

I have been able to get into the "root@proto: / #" and have tried to add the minidlna package but am unable to get the files.

i get this everytime,

Code: Select all

Error: Unable to get ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-9.1-release/Latest/minidlna.tbz: No address record
pkg_add: unable to fetch 'ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-9.1-release/Latest/minidlna.tbz' by URL
What am i doing wrong?

cheers,

today 2 of January, still do not exist 9.1 branch. see: ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/

So you need to use setenv like if it was in RC3 state still.

Re: [HOWTO] Install minidlna into a jail

Posted: 12 Jan 2013 15:58
by DanAddz
Hay,

I have managed to get this to work and be able to see the Minidlna in my Bluray player, but when i click on one of the videos it comes up with "this file is corrupt or unsupported,"

What do you think is wrong?

I have created the Group dlna on 933 and user on 933 with no password. what else am i support to do?

Also how can i manually make it rescan?

Also how do you log in to minidlan? e.g. root@minidlna? what is the password?

regards,

Re: [HOWTO] Install minidlna into a jail

Posted: 12 Jan 2013 19:50
by raulfg3
Minidlna do not transcode, so You need a video encoded in a way that your render understand. Try others video files, if none works, perhaps is other problem.

To manually do a rescan, execute the rescan with full path, like You write in the cron, inside the jail.

/usr/local/etc/rc.d/minidlna rescan

To log in minidlna, You need to type IP of Jail :8200
Eg: http://192.168.1.202:8200

If this is not what You want, perhaps You ask about log into Jail minidlna.

As i say in the first lines of first post, You need to type Jls, and jexec number of Jail csh

Re: [HOWTO] Install minidlna into a jail

Posted: 13 Jan 2013 01:48
by DanAddz
Hay, I ment how did you get to this part - root@minidlna:/ # - so I can create the cron?

My videos are in MPEG at the moment. What file format do you suggest I try??

Also i have tried to rescan and my minidlna is not finding my photos and audio files?


Cheers

Re: [HOWTO] Install minidlna into a jail

Posted: 13 Jan 2013 10:59
by raulfg3
DanAddz wrote:ay, I ment how did you get to this part - root@minidlna:/ # - so I can create the cron?
Log into your jail ( in my case is minidlna, but if your jail is named proto once log, you see: root@proto:/ #

once log inside your jail, you need to define a default editor ( I define ee, and edit crontab

Code: Select all

crontab -e

Re: [HOWTO] Install minidlna into a jail

Posted: 13 Jan 2013 11:07
by raulfg3
DanAddz wrote:My videos are in MPEG at the moment. What file format do you suggest I try??
one supported by your bluray player, normally *.avi are the best compatible ones.

DanAddz wrote:Also i have tried to rescan and my minidlna is not finding my photos and audio files?
, revise that you have photos & Music inside your jail.

post more info about your install, eg: what is the name of your jail, if is proto, post fstab.proto, revise that you have correct mount points in /mnt/ inside your jail post result of jls to see what IP do you use.

remember that you can search for audio files into Audio folders ( UpnP or DLN segregate content in 3 blocks Video, Audio, Photos).

Revise your minidlna.conf that point to correct Video, Audio, Photos path inside your jail ( and post the file minidlna.conf so I can revise it), etc...

Re: [HOWTO] Install minidlna into a jail

Posted: 13 Jan 2013 14:10
by DanAddz
Ok

I have tested this and it works with .avi files, so thats fine.

my pictures have now come up as well.

But they only come up if i reboot the Server, it doesnt refresh if i type in the code you gave me.

Why wont it refresh when i type /usr/local/etc/rc.d/minidlna rescan????

Thanks,

Re: [HOWTO] Install minidlna into a jail

Posted: 13 Jan 2013 15:50
by raulfg3
I do not know, revise and post minidlna.log.

Re: [HOWTO] Install minidlna into a jail

Posted: 14 Jan 2013 04:54
by DanAddz
Hay i am at work at the moment so i am unable to get in to get this for you,

just out of curiosity would this not make it automatically see new files??

Code: Select all

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

Re: [HOWTO] Install minidlna into a jail

Posted: 14 Jan 2013 07:44
by raulfg3
Because inotify is designed and only works in Linux, so because of this You need to rescan by cron or manually ( like fuppes when work).


PD: if You want automatic rescan, install serviio instead.

Re: [HOWTO] Install minidlna into a jail

Posted: 14 Jan 2013 07:47
by DanAddz
oh ok,

No i like this MiniDLNA, once i can get the logs i will post them for you, i should be able to get them in the next 20 mins. when you rescan your minidlna and then go to 192.168.1.201:8200 or what ever yours is set to, do the figures change to show the new amounts?

regards,
Dan

Re: [HOWTO] Install minidlna into a jail

Posted: 14 Jan 2013 07:55
by raulfg3
DanAddz wrote:oh ok,

No i like this MiniDLNA, once i can get the logs i will post them for you, i should be able to get them in the next 20 mins. when you rescan your minidlna and then go to 192.168.1.201:8200 or what ever yours is set to, do the figures change to show the new amounts?
Dan
Yes, when rescan and i add more files, there are show/actualized.

Re: [HOWTO] Install minidlna into a jail

Posted: 14 Jan 2013 08:01
by DanAddz
Hmmm,

Mine comes up with the exact same file amounts as last time, doesnt update that there is more or less.

Re: [HOWTO] Install minidlna into a jail

Posted: 14 Jan 2013 08:52
by DanAddz
Hay,

I have attached the minidlna log for you and the fstab.proto for you so you can revise.

thanks for the help.

Cheers,
Dan

Re: [HOWTO] Install minidlna into a jail

Posted: 14 Jan 2013 08:53
by raulfg3
post your log, there is in /jail/proto/var/minidlna/minidlna.log if you do not change it. done

open a shell and go to /jail/proto/var/bd and see if minidlna.db grow in size when you add 100 files and start rescan.

If not revise permission and post ls -l of /jail/proto/var /jail/proto/var/db /jail/proto/var/minidlna

Re: [HOWTO] Install minidlna into a jail

Posted: 14 Jan 2013 09:01
by raulfg3

Code: Select all

[2013/01/13 12:06:12] scanner.c:808: warn: Scanning /mnt/Videos finished (23 files)!
[2013/01/13 12:06:12] scanner.c:737: warn: Scanning /mnt/Music
[2013/01/13 12:06:12] scanner.c:808: warn: Scanning /mnt/Music finished (23 files)!
[2013/01/13 12:06:12] scanner.c:737: warn: Scanning /mnt/Photos
[2013/01/13 12:06:12] scanner.c:808: warn: Scanning /mnt/Photos finished (45 files)!

Code: Select all

[2013/01/13 19:05:23] scanner.c:808: warn: Scanning /mnt/Videos finished (24 files)!
[2013/01/13 19:05:23] scanner.c:737: warn: Scanning /mnt/Music
[2013/01/13 19:05:23] scanner.c:808: warn: Scanning /mnt/Music finished (24 files)!
[2013/01/13 19:05:23] scanner.c:737: warn: Scanning /mnt/Photos
[2013/01/13 19:05:23] scanner.c:808: warn: Scanning /mnt/Photos finished (46 files)!

Code: Select all

[2013/01/13 20:57:55] scanner.c:808: warn: Scanning /mnt/Videos finished (3 files)!
[2013/01/13 20:57:55] scanner.c:737: warn: Scanning /mnt/Music
[2013/01/13 20:57:55] scanner.c:808: warn: Scanning /mnt/Music finished (3 files)!
[2013/01/13 20:57:55] scanner.c:737: warn: Scanning /mnt/Photos
[2013/01/13 20:57:55] scanner.c:808: warn: Scanning /mnt/Photos finished (25 files)!

Code: Select all

[2013/01/14 15:34:23] scanner.c:808: warn: Scanning /mnt/Videos finished (4 files)!
[2013/01/14 15:34:23] scanner.c:737: warn: Scanning /mnt/Music
[2013/01/14 15:34:23] scanner.c:808: warn: Scanning /mnt/Music finished (4 files)!
[2013/01/14 15:34:23] scanner.c:737: warn: Scanning /mnt/Photos
[2013/01/14 15:34:23] scanner.c:808: warn: Scanning /mnt/Photos finished (26 files)!

I see that number of files change, please revise if is coherent with your test, and try to add more files ( eg: 100 video files), and do a manual rescan, you can see that minidlna is doing a rescan , simply seeing that hard disk led , blink, or in service | proceses that minidlna is on top and eat all time of the CPU.

Re: [HOWTO] Install minidlna into a jail

Posted: 14 Jan 2013 09:24
by DanAddz
ok,

the reason that the files have been going up and down is because i was trying to test it changing, now can you tell if that was rescanning when i told it to or was it only rescanning when i rebooted it? because i had to reboot the nas to get it to recognize that i had changed the amount of files. Therefore the rescan works only when i reboot.

i have got those permissions for you.

/jail/minidlna/var

Code: Select all

drwxr-xr-x  2 root    wheel   512 Dec  4 09:32 account
drwxr-xr-x  4 root    wheel   512 Dec  4 09:32 at
drwxr-x---  2 root    audit   512 Dec  4 09:32 audit
drwxr-x---  2 root    wheel   512 Jan 13 19:01 backups
drwxr-x---  2 root    wheel   512 Dec  4 09:32 cache
drwxr-x---  2 root    wheel   512 Dec  4 09:34 crash
drwxr-x---  3 root    wheel   512 Dec  4 09:32 cron
drwxr-xr-x  9 root    wheel   512 Jan 12 14:20 db
dr-xr-xr-x  2 root    wheel   512 Dec  4 09:32 empty
drwxrwxr-x  2 root    games   512 Dec  4 09:32 games
drwx------  2 root    wheel   512 Dec  4 09:32 heimdal
drwxr-xr-x  2 root    wheel   512 Jan 13 19:01 log
drwxrwxr-x  2 root    mail    512 Jan 13 19:01 mail
drwxr-xr-x  2 daemon  wheel   512 Jan 12 10:20 msgs
drwxr-xr-x  5 root    wheel   512 Dec  4 09:32 named
drwxr-xr-x  2 root    wheel   512 Dec  4 09:32 preserve
drwxr-xr-x  5 root    wheel   512 Jan 13 18:00 run
drwxrwxr-x  2 root    daemon  512 Dec  4 09:32 rwho
drwxr-xr-x  8 root    wheel   512 Dec  4 09:33 spool
drwxrwxrwt  3 root    wheel   512 Jan 12 10:32 tmp
drwxr-xr-x  2 root    wheel   512 Dec  4 09:34 yp
/jail/minidlna/var/db

Code: Select all

drwx------   2 operator  operator    512 Jan 14 08:11 entropy
drwx------   2 root      wheel       512 Dec  4 09:32 freebsd-update
drwx------   2 root      wheel       512 Dec  4 09:32 ipf
-rw-r--r--   1 nobody    wheel         0 Dec  4 09:34 locate.database
-rw-------   1 root      wheel     40468 Dec  4 09:34 mergemaster.mtree
drwxr-xr-x   2 dlna      dlna        512 Jan 14 07:34 minidlna
drwxr-xr-x  24 root      wheel      1024 Jan 12 10:32 pkg
drwxr-xr-x   2 root      wheel       512 Dec  4 09:32 ports
drwxr-xr-x   2 root      wheel       512 Dec  4 09:32 portsnap
/jail/minidlna/var/minidlna
This one said that the directory didnt exist.

I do not have 100 files to transfer at the moment, there on another PC i am only testing this at the moment so that when i bring everything over it works perfectly.

i Know that my Nas rescans when i reboot it. but i cannot get it to rescan manually.

regards,
Dan

Re: [HOWTO] Install minidlna into a jail

Posted: 14 Jan 2013 11:14
by raulfg3
You have proper permision in

Code: Select all

drwxr-xr-x   2 dlna      dlna        512 Jan 14 07:34 minidlna
but comfirm that you install minidlna into jail named proto and your ls -l is in reality of /jail/proto/var/db/ ( In bold you put /jail/minidlna/var/db)


once confirmed I need ls -l of /jail/proto/var/db/minidlna/ to see if minidlna.pid exist and what pwermision have.

minidlna.pid and minidlna.uid is needed by /usr/local/etc/rc.d/minidlna
to define a new action named rescan:

Code: Select all

#!/bin/sh

# $FreeBSD: ports/net/minidlna/files/minidlna.sh.in,v 1.5 2012/05/08 02:31:27 mi Exp $
#
# PROVIDE: minidlna
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following line to /etc/rc.conf[.local] to enable minidlna:
#
# minidlna_enable="YES"

. /etc/rc.subr

name=minidlna
rcvar=minidlna_enable
command=/usr/local/sbin/minidlna

load_rc_config $name

minidlna_enable=${minidlna_enable-"NO"}
minidlna_uid=${minidlna_uid-"dlna"}

pidfile="/var/db/minidlna/minidlna.pid"

start_precmd="rm -f $pidfile"
stop_postcmd=$start_precmd

[color=#FF0000]command_args="-P $pidfile -u $minidlna_uid"
extra_commands=rescan
rescan_cmd="$command -R -u $minidlna_uid"
required_dirs="/var/db/minidlna"[/color]
run_rc_command $1
I think that something involved minidlna.pid and minidlna.uid is wrong, please try to locate this 2 files, and check permission and check content ( use command cat minidlna.uid for example.

Content of minidlna.pid must be the PID of minidlna , you can compare it using ps ax | grep minidlna , and can be the same

Re: [HOWTO] Install minidlna into a jail

Posted: 14 Jan 2013 11:33
by DanAddz
hay,

it is called proto, sorry i copied your post when referencing mine so confused the both of us lol.

I have been able to get /jail/proto/var/db/minidlna/

Code: Select all

total 136
-rw-r--r--  1 dlna  dlna  122880 Jan 14 07:34 files.db
-rw-r--r--  1 root  dlna   10367 Jan 14 07:34 minidlna.log
-rw-r--r--  1 root  dlna       5 Jan 13 13:01 minidlna.pid
i have searched for minidlna.uid and i cannot locate this on my has?

thanks for the help.
Dan

Re: [HOWTO] Install minidlna into a jail

Posted: 14 Jan 2013 19:31
by raulfg3
I have more or less the same, and rescan work for me:

Code: Select all

rnas:/mnt/NAS-A/Temp# jls
   JID  IP Address      Hostname                      Path
     1  192.168.1.201   serviio                       /jail/serviio
     2  192.168.1.202   kissdx                        /jail/kissdx
     3  192.168.1.203   minidlna                      /jail/minidlna
rnas:/mnt/NAS-A/Temp# jexec 3 csh
You have mail.
root@minidlna:/ # cd /var/db
root@minidlna:/var/db # ls -l
total 57
drwx------   2 operator  operator     10 Jan 14 19:11 entropy
drwx------   2 root      wheel         2 Dec  4 10:32 freebsd-update
drwx------   2 root      wheel         2 Dec  4 10:32 ipf
-r--r--r--   1 nobody    wheel         0 Jan 12 04:15 locate.database
-rw-------   1 root      wheel     40468 Dec  4 10:34 mergemaster.mtree
drwxr-xr-x   3 dlna      dlna          6 Jan 14 02:08 minidlna
drwxr-xr-x  24 root      wheel        24 Jan  2 23:37 pkg
drwxr-xr-x   2 root      wheel         2 Dec  4 10:32 ports
drwxr-xr-x   2 root      wheel         2 Dec  4 10:32 portsnap
root@minidlna:/var/db # cd minidlna
root@minidlna:/var/db/minidlna # ls -l
total 21913
drwxr-xr-x  3 dlna  dlna          3 Jan 14 02:08 art_cache
-rw-r--r--  1 dlna  dlna   22294528 Jan 14 02:50 files.db
-rw-r--r--  1 root  wheel     28482 Jan 14 02:50 minidlna.log
-rw-r--r--  1 root  dlna          5 Jan 12 13:07 minidlna.pid
root@minidlna:/var/db/minidlna # cat minidlna.pid
3703
root@minidlna:/var/db/minidlna # ps ax |grep minidlna
 3703 ??  IsJ  0:01.37 /usr/local/sbin/minidlna -P /var/db/minidlna/minidlna.pi
28279  0  R+J  0:00.01 grep minidlna
root@minidlna:/var/db/minidlna # uid dlna
uid: Command not found.
root@minidlna:/var/db/minidlna # id dlna
uid=933(dlna) gid=933(dlna) groups=933(dlna)
root@minidlna:/var/db/minidlna #

I have minidlna rescan put ar 02:00 all days , and I revise the log, and cron is executed and minidlna rescan:

Code: Select all

[2013/01/12 02:00:03] minissdp.c:815: error: connect("/var/run/minissdpd.sock"): No such file or directory
[2013/01/12 02:00:03] minidlna.c:1009: fatal: Failed to connect to MiniSSDPd. EXITING
[2013/01/12 02:00:03] scanner.c:737: warn: Scanning /mnt/Video
[2013/01/12 02:00:03] minissdp.c:108: error: bind(udp): Address already in use
[2013/01/12 02:00:02] minidlna.c:940: warn: Creating new database...
[2013/01/12 02:00:02] minidlna.c:917: warn: Starting MiniDLNA version 1.0.24 [SQLite 3.7.14.1].

Re: [HOWTO] Install minidlna into a jail

Posted: 15 Jan 2013 04:46
by DanAddz
ok,

I have tested some things and have got some more information for you, maybe this will help to show you what the answer to my problem is.

My minidlna is rescanning at 02:00 every time and has successfully seen that yesterday there was 3 videos and now there is 4. However when i go to my 192.168.1.201:8200 it only shows 3 videos, Not 4. And the client that is receiving the videos (Samsung bluray player) is only showing 3 videos.

How is it that my rescan sees that there is 4 videos but my minidlna ony says 3 videos?

Also, if i Reboot the Nas, it stops minidlna and then starts it again, then i can see the 4 videos?

is there anyway i can get it to rather then rescan at 02:00, can i get it to stop minidlna and start minidlna at 02:00???

I have tested stopping minidlna and then starting minidlna and it did not find the new file. How does it find them when i reboot the nas?


Thanks,
Dan