Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.

How to Install MiniDLNA on FreeNAS 9.3 (Prior to Plugin)

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
8,257
Anyone installed minidlna in a iocage yet ? I’ll give it a try this week-end and report back.
I wasn't planning to do anything with it until 11.2-RC1 comes out. Everything was just so flaky and it wasn't worth investing time when the GUI was changing. I appreciate you going through the motions. What I'd recommend you do is to create a new thread titled "How to Install MiniDLNA into iocage (FreeNAS 11.2 and later)", and if you wouldn't mind it, add some good detailed instructions in a similar manner that I did on the first posting in this thread. It really helps to have things like this very well documented. If you would rather not do it then I can when RC1 comes out.
 

hervon

FreeNAS Experienced
Joined
Apr 23, 2012
Messages
255
joeschmuck, your walk through still works wonderfully. I installed minidlna is iocage following most of the steps in the OP. Thanks!

As suggested, this week-end i'll create a new thread how to install minidlna in iocage that will contain most of this OP. Since English is not my first language, don't hesitate to comment.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
8,257
This question is not related to this thread.

https://redmine.ixsystems.com/projects/freenas/roadmap
About 2 months can really mean about 3 to 4 months, just to put it into perspective.

joeschmuck, your walk through still works wonderfully. I installed minidlna is iocage following most of the steps in the OP. Thanks!

As suggested, this week-end i'll create a new thread how to install minidlna in iocage that will contain most of this OP. Since English is not my first language, don't hesitate to comment.
Thanks. Have no fear, I'm more than happy to offer my advice and I can edit your postings if you desire, if it makes sense of course, but I don't want to steal anyones work. And I have no problems with you using what I have given, it's for everyone and if my instructions work or some of them do, feel free to copy them. The goal is to produce a well written thread that helps others.
 

marcevan

FreeNAS Experienced
Joined
Dec 15, 2013
Messages
370
edited with some success.

Situation: I have Control4 and FreeNAS and all my music (years working in music industry yields > 25k songs).

Problem: FreeNAS deprecated Samba1 and although it's possible to tunable it back, I loathe buggy, unsecure, deprecated code. Enter the world of DLNA. With Control4 you can on demand from a lot of DLNA servers; however, to program a song to play thru DLNA in a room at a certain time/situation, they currently use a search command for album and Plex does not allow searching in DLNA. Hence moved to miniDLNA in a jail. miniDLNA is not great for large collections such as my own and it drops fairly regularly.

Solution: In the miniDLNA jail cron is already there so crontab -e to enter * * * * /script.sh to run that script each minute. Code the script to the tune of
Code:
UP=$(/usr/local/etc/rc.d/minidlna status | grep "is running" | grep -v not | wc -l);												
if [ "$UP" -ne 1 ];																												 
then																																
	echo "service miniDLNA is down";																							   
	service minidlna start																										 
else																																
	echo "service miniDLNA is running already";																					
fi


And you can check each minute to see if miniDLNA is down in rc.d and restart it.
 
Last edited:

Jedrek

Newbie
Joined
May 25, 2017
Messages
27
I noticed that after updating Freenas to version 11.1 U6 there is a problem with miniDLNA. The launched server after a few minutes disappears from the network environment and shared with it the media. After manuakl restart too.
I do not know where the problem lies. I have a big collection of photos, video and musics (samples)


log:


[2018/09/06 21:13:31] (DEBUG) ServiceService._simplecmd():271 - Calling: restart(webshell)

[2018/09/06 21:13:56] (DEBUG) common.warden.__init__():406 - warden_base.__init__: cmd = stop - flags = 0x00000000

[2018/09/06 21:13:56] (DEBUG) common.warden.__init__():437 - warden_base.__init__: args = 'MiniDLNA'

[2018/09/06 21:13:56] (DEBUG) common.warden.__init__():443 - warden_base.__init__: leave

[2018/09/06 21:13:56] (DEBUG) common.warden.run():449 - warden_base.run: enter

[2018/09/06 21:13:56] (DEBUG) common.warden.run():458 - warden_base.cmd = /usr/local/bin/warden stop 'MiniDLNA'

[2018/09/06 21:13:56] (DEBUG) common.cmd.__init__():189 - cmd_pipe.__init__: cmd = /usr/local/bin/warden stop 'MiniDLNA', kwargs = {'pipeopen_kwargs': {}}

[2018/09/06 21:13:58] (DEBUG) common.cmd.__init__():208 - cmd_pipe.__init__: out = Stoppingthejail....192.168.0.203 (192.168.0.203) deleted

[2018/09/06 21:13:58] (DEBUG) common.cmd.__init__():208 - cmd_pipe.__init__: out = Unmounting user-supplied file-systems

[2018/09/06 21:13:58] (DEBUG) common.cmd.__init__():208 - cmd_pipe.__init__: out = Stopping jail with: /etc/rc.shutdown

[2018/09/06 21:13:58] (DEBUG) common.cmd.__init__():208 - cmd_pipe.__init__: out = ...Done

[2018/09/06 21:13:58] (DEBUG) common.cmd.__init__():219 - cmd_pipe.__init__: leave

[2018/09/06 21:13:58] (DEBUG) common.warden.run():467 - warden_base.run: leave

[2018/09/06 21:13:58] (DEBUG) common.warden.__init__():406 - warden_base.__init__: cmd = start - flags = 0x00000000

[2018/09/06 21:13:58] (DEBUG) common.warden.__init__():437 - warden_base.__init__: args = 'MiniDLNA'

[2018/09/06 21:13:58] (DEBUG) common.warden.__init__():443 - warden_base.__init__: leave

[2018/09/06 21:13:58] (DEBUG) common.warden.run():449 - warden_base.run: enter

[2018/09/06 21:13:58] (DEBUG) common.warden.run():458 - warden_base.cmd = /usr/local/bin/warden start 'MiniDLNA'

[2018/09/06 21:13:58] (DEBUG) common.cmd.__init__():189 - cmd_pipe.__init__: cmd = /usr/local/bin/warden start 'MiniDLNA', kwargs = {'pipeopen_kwargs': {'env': {'PATH': '/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/root/bin'}, 'start_new_session': True}}

[2018/09/06 21:13:59] (DEBUG) common.cmd.__init__():208 - cmd_pipe.__init__: out = Mounting user-supplied file-systems

[2018/09/06 21:13:59] (DEBUG) common.cmd.__init__():208 - cmd_pipe.__init__: out = jail -c path=/mnt/Extra_space/jails/MiniDLNA name=MiniDLNA host.hostname=MiniDLNA allow.raw_sockets=true persist vnet=new

[2018/09/06 21:13:59] (DEBUG) common.cmd.__init__():208 - cmd_pipe.__init__: out = Setting IPv4 address: 192.168.0.203/24

[2018/09/06 21:13:59] (DEBUG) common.cmd.__init__():208 - cmd_pipe.__init__: out = inet6_enable: YES -> YES

[2018/09/06 21:13:59] (DEBUG) common.cmd.__init__():208 - cmd_pipe.__init__: out = ip6addrctl_enable: YES -> YES

[2018/09/06 21:13:59] (DEBUG) common.cmd.__init__():208 - cmd_pipe.__init__: out = add net default: gateway 192.168.0.1

[2018/09/06 21:13:59] (DEBUG) common.cmd.__init__():208 - cmd_pipe.__init__: out = Starting jail with: /etc/rc

[2018/09/06 21:13:59] (DEBUG) common.cmd.__init__():210 - cmd_pipe.__init__: err = ls: /usr/pbi/*-amd64/lib: No such file or directory

[2018/09/06 21:13:59] (DEBUG) common.cmd.__init__():219 - cmd_pipe.__init__: leave

[2018/09/06 21:13:59] (DEBUG) common.warden.run():467 - warden_base.run: leave
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
8,257
Problem was solved by upgrading package minidlna
I started testing this out last night and tried to repeat your problem and when I went to upgrade from FreeNAS 11.1-U4 to 11.1-U6 on my test machine it just hosed up my system. I had to revert back to U4 and delete the U6 boot files. After that I was too irritated to move forward so I stopped. I was just getting back to it now and I see you have simply updated the package. Can you post exactly what commands you used please? I don't want to jump through all the hoops to recreate this scenario since you have already gone through it and solved it. I wouldn't imagine this would be an issue for a new install.

Cheers,
-Joe
 

marcevan

FreeNAS Experienced
Joined
Dec 15, 2013
Messages
370
I started testing this out last night and tried to repeat your problem and when I went to upgrade from FreeNAS 11.1-U4 to 11.1-U6 on my test machine it just hosed up my system. I had to revert back to U4 and delete the U6 boot files. After that I was too irritated to move forward so I stopped. I was just getting back to it now and I see you have simply updated the package. Can you post exactly what commands you used please? I don't want to jump through all the hoops to recreate this scenario since you have already gone through it and solved it. I wouldn't imagine this would be an issue for a new install.

Cheers,
-Joe
Well, I can say for sure that miniDLNA is not really a good fit for large music collections. I've since removed it as even with a restart script it assumes a new PID which in turn means the DLNA client looking for it like Control4 thinks it's down until you manually search for available servers and it finds it again as a new instance.

Now I'm looking at Emby DLNA as it's similar to Plex's DLNA but does allow for search, which is a requirement of programming in Control4. I suspect Plex could update their DLNA to include search but they will always have bigger fish to fry so not holding my breath, and taking action. Problem is that I can find Emby DLNA server on my Windows Media Player, but not in Control4 yet.

And then again, let's just all be patient for 11.2 STABLE or at least Beta3 which allows for upgrading from 11.1U6.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
8,257
And then again, let's just all be patient for 11.2 STABLE or at least Beta3 which allows for upgrading from 11.1U6.
Is FreeNAS 11.2 incorporating a DLNA service?

What are compatable DLNA servers for Control4? Maybe limit it to Linux/BSD type OS. You can run a small OS in a jail/iohyve and make this work.

Have you read this and does it look like it will support your needs?
https://www.chowmainsoft.com/plex-full-driver-for-control4/

If you can use Plex and a paid driver, why not. Holy Cow! $200.00 might be why not. That is one very expensive driver.
 

marcevan

FreeNAS Experienced
Joined
Dec 15, 2013
Messages
370
Plex's DLNA server doesn't support searching for artist, album, song, etc. Control4 programming uses a search so if you want to listen to a song at a certain time in a room there's a dialog box to search by album name which fails if Plex is the DLNA server.

I'll explore further.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
8,257
Plex's DLNA server doesn't support searching for artist, album, song, etc. Control4 programming uses a search so if you want to listen to a song at a certain time in a room there's a dialog box to search by album name which fails if Plex is the DLNA server.

I'll explore further.
The driver may not use Plex DLNA but rather Plex Server. But agfain, $200 is a bit too much for my blood.
 
Joined
Nov 23, 2018
Messages
3
Never mind message below. It's good to ensure that the MiniLDNA jail doesn't share the same IP address as another server on the same subnet... :( Rolli'n on with step #21 now. :)


Thanks for an excellent guide! :) But I'm stuck on #20a with below message. I think I read someware that all pkg commands at prompt are dissabled in release 11.x, is that a possibility why I get stuck? I'm running a fresh FreeNAS 11.1 u6.
Thank you in advance, /Jocke

root@miniDNLA:/ # pkg install minidlna
Updating FreeBSD repository catalogue...
pkg: Repository FreeBSD load error: access repo file(/var/db/pkg/repo-FreeBSD.sqlite) failed: No such file or directory
pkg: http://pkg.FreeBSD.org/freebsd:11:x86:64/latest/meta.txz: No address record
repository FreeBSD has no meta file, using default settings
pkg: http://pkg.FreeBSD.org/freebsd:11:x86:64/latest/packagesite.txz: No address record
Unable to update repository FreeBSD
Error updating repositories!
 
Last edited:

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
8,257
Glad that you identified your issue, hope it all works out.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
8,257
I have updated the original instructions on page 1 of this thread to also include the new FreeNAS 11.2 GUI. I performed a clean install of FreeNAS 11.2, performed the basic configurations required to make a basic functional FreeNAS (networking, naming, pool, etc...), created a single share and placed two movies on it. Then I proceeded to create my jail following the instruction on page 1. The only issue I discovered was selecting the proper network adapter within the jail configuration when not using DHCP. If you fail to have proper network connectivity then of course you will fail trying to install MiniDLNA.

If people think that having the instructions interlaced as I did it are too confusing, please speak up. I could just create two sections. The main reason I did it this way was to ensure the step numbers basically stayed the same because old problems/solutions are in the thread and keeping things common could help someone out.

Additionally @hervon has created this thread for installing MiniDLNA. I think it works very well. So now you have two options, both good.
 
Joined
Nov 23, 2018
Messages
3
Hi (again),

I'm at #33 and found a dependency that's not there. Any work around for this, anyone?

root@miniDNLA:/ # service minidlna onestart
Starting minidlna.
Shared object "libdl.so.1" not found, required by "libgnutls.so.30"
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
8,257
Hi (again),

I'm at #33 and found a dependency that's not there. Any work around for this, anyone?

root@miniDNLA:/ # service minidlna onestart
Starting minidlna.
Shared object "libdl.so.1" not found, required by "libgnutls.so.30"
It would help to know what version of FreeNAS you are running, was this an upgrade from one previous FreeNAS version, is this a new Jail? Also, back up to step 16 or you can delete the jail and try again from the beginning paying close attention to steps 16 through 21a. Make sure you don't have any error messages there. All dependancies should be installed during the installation.

Also, if this is the New GUI (FreeNAS 11.2) then please try @hervon instructions and if you see something I got wrong, please point it out to me.
 
Top