MiniDLNA Automatic Scan - Fix

Status
Not open for further replies.

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
On that note, would you recommend setting the Transmission download folder to a different folder to "/media"? I concluded that was my problem after minidlna only seemed to be showing a fraction of my movie files (presumably because it was restarting every minute or so).
You should set up transmission files into a separate folder if you are going to use the automated fix for MiniDLNA. As you found out, any change no matter how minor in the monitored folder will trigger an event to kill and restart MiniDLNA.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
Your updated code works perfectly! Actually, it works too good for me. ;-) Let me explain. I stream my movies from my FreeNAS server to a WDTVLive. The problem is that the WDTVLive creates an hidden folder with information about the current movie to allows resume at the current time in the movie. So I played a movie tonight. The folder change was detected and MiniDLNA restarted after 300 seconds! If I could exclude a folder, it would fix my problem. For now, I reverted to the previous version withe selected folder to watch for changes.
I don't think there is a way to exclude a folder but does the folder always have the same name? Is it possible to setup a default directory location? I briefly read the WDTVLive user manual and do you think this is the Media Library mentioned on page 198 of the users manual? I'm also working on something else that might help you but it's slow a process. This would not kill the minidlna process but actually perform a rescan. The rescan also has the possibility of causing an issue if you have a slow machine for the NAS as it's rescanning but at least it shouldn't kill the stream or that's my goal.

Another work around is to modify the sleep 300 to a much higher value but I don't particularly like that so I think you have found the best option for your situation right now. And when I get the rescanning to work without killing the minidlna process, I'll post it but I will put this out here now, it isn't the MiniDLNA plugin, MiniDLNA will need to be installed manually and all it's support files. Not a hard process and it's already documented but I haven't done much with it inside a plugin environment and still working that angle.
 

hervon

Patron
Joined
Apr 23, 2012
Messages
353
I cannot define a different location for the folder '.wd_tv' created by the WDTVLive. So, as you said, I think I have found the best option for now. I'll keep an eye on this thread for future implementations of your already useful MiniDLNA Scan Fix. Thanks.
 

loybuckz

Cadet
Joined
Oct 22, 2012
Messages
1
Hi there! I need some help. Im not familiar with freebsd and trying to do this fix to auto-update my media list. I keep on receiving an "unable to get ftp://..." error on step 4.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
Hi there! I need some help. Im not familiar with freebsd and trying to do this fix to auto-update my media list. I keep on receiving an "unable to get ftp://..." error on step 4.
Did you type the line correctly? The only thing I can think of is you typed "pkg_add -r wait on" vice "pkg_add -r wait_on". If that doesn't work please paste the entire error message. Let me know if that works.
 

Alejometal

Dabbler
Joined
May 27, 2011
Messages
10
I've followed all the steps that you've posted and it works but not properly. Now I can't watch anything to its end, because miniDLNA it's restarting all the time. it's so annoying. and I haven't been adding anything to that folder. Transmission is pointing to other folder so it's not related to that. It is just sharing the folder with subsonic. but I don't think it could affect it. I hope you manage to get the rescanning to work without killing the miniDLNA process soon. Meanwhile I will have to remove this tweak. How can I removed it properly?

I'm running FreeNAS 8.3-release.

thanks
Alex

Code:
Oct 30 01:38:31 FREENAS kernel: pid 10279 (minidlna), uid 40002: exited on signal 11
Oct 30 01:45:13 FREENAS kernel: pid 14009 (minidlna), uid 40002: exited on signal 11
Oct 30 01:51:47 FREENAS kernel: pid 17512 (minidlna), uid 40002: exited on signal 11
Oct 30 01:58:00 FREENAS kernel: pid 20968 (minidlna), uid 40002: exited on signal 11
Oct 30 02:03:23 FREENAS kernel: pid 24421 (minidlna), uid 40002: exited on signal 11
Oct 30 02:08:39 FREENAS kernel: pid 27917 (minidlna), uid 40002: exited on signal 11
Oct 30 02:13:58 FREENAS kernel: pid 31357 (minidlna), uid 40002: exited on signal 11
Oct 30 02:19:17 FREENAS kernel: pid 34813 (minidlna), uid 40002: exited on signal 11
Oct 30 02:24:34 FREENAS kernel: pid 38254 (minidlna), uid 40002: exited on signal 11
Oct 30 02:29:49 FREENAS kernel: pid 41716 (minidlna), uid 40002: exited on signal 11
Oct 30 02:35:08 FREENAS kernel: pid 45160 (minidlna), uid 40002: exited on signal 11
Oct 30 02:40:24 FREENAS kernel: pid 48616 (minidlna), uid 40002: exited on signal 11
Oct 30 02:45:41 FREENAS kernel: pid 52062 (minidlna), uid 40002: exited on signal 11
Oct 30 02:50:56 FREENAS kernel: pid 55515 (minidlna), uid 40002: exited on signal 11
Oct 30 02:56:14 FREENAS kernel: pid 58956 (minidlna), uid 40002: exited on signal 11
Oct 30 03:01:37 FREENAS kernel: pid 62412 (minidlna), uid 40002: exited on signal 11
Oct 30 03:07:08 FREENAS kernel: pid 66227 (minidlna), uid 40002: exited on signal 11
Oct 30 03:12:10 FREENAS kernel: pid 69812 (minidlna), uid 40002: exited on signal 11
Oct 30 03:17:29 FREENAS kernel: pid 73268 (minidlna), uid 40002: exited on signal 11
Oct 30 03:22:44 FREENAS kernel: pid 76743 (minidlna), uid 40002: exited on signal 11
Oct 30 03:27:58 FREENAS kernel: pid 80199 (minidlna), uid 40002: exited on signal 11
Oct 30 03:33:19 FREENAS kernel: pid 83636 (minidlna), uid 40002: exited on signal 11
Oct 30 03:38:33 FREENAS kernel: pid 87156 (minidlna), uid 40002: exited on signal 11
Oct 30 03:43:51 FREENAS kernel: pid 90596 (minidlna), uid 40002: exited on signal 11
Oct 30 03:49:08 FREENAS kernel: pid 94052 (minidlna), uid 40002: exited on signal 11
Oct 30 03:54:23 FREENAS kernel: pid 97501 (minidlna), uid 40002: exited on signal 11
Oct 30 03:59:38 FREENAS kernel: pid 1059 (minidlna), uid 40002: exited on signal 11
Oct 30 04:04:55 FREENAS kernel: pid 4568 (minidlna), uid 40002: exited on signal 11
Oct 30 04:10:15 FREENAS kernel: pid 8008 (minidlna), uid 40002: exited on signal 11
Oct 30 04:15:30 FREENAS kernel: pid 11461 (minidlna), uid 40002: exited on signal 11
Oct 30 04:20:47 FREENAS kernel: pid 14907 (minidlna), uid 40002: exited on signal 11
Oct 30 04:26:02 FREENAS kernel: pid 18364 (minidlna), uid 40002: exited on signal 11
Oct 30 04:31:21 FREENAS kernel: pid 21804 (minidlna), uid 40002: exited on signal 11
Oct 30 04:36:39 FREENAS kernel: pid 25270 (minidlna), uid 40002: exited on signal 11
Oct 30 04:41:56 FREENAS kernel: pid 28711 (minidlna), uid 40002: exited on signal 11
Oct 30 04:47:14 FREENAS kernel: pid 32151 (minidlna), uid 40002: exited on signal 11
Oct 30 04:52:27 FREENAS kernel: pid 35607 (minidlna), uid 40002: exited on signal 11
Oct 30 04:57:44 FREENAS kernel: pid 39051 (minidlna), uid 40002: exited on signal 11
Oct 30 05:03:03 FREENAS kernel: pid 42507 (minidlna), uid 40002: exited on signal 11
Oct 30 05:08:19 FREENAS kernel: pid 45977 (minidlna), uid 40002: exited on signal 11
Oct 30 05:13:35 FREENAS kernel: pid 49441 (minidlna), uid 40002: exited on signal 11
Oct 30 05:18:56 FREENAS kernel: pid 52897 (minidlna), uid 40002: exited on signal 11
Oct 30 05:24:11 FREENAS kernel: pid 56338 (minidlna), uid 40002: exited on signal 11
Oct 30 05:29:25 FREENAS kernel: pid 59794 (minidlna), uid 40002: exited on signal 11
Oct 30 05:34:42 FREENAS kernel: pid 63244 (minidlna), uid 40002: exited on signal 11
Oct 30 05:40:00 FREENAS kernel: pid 66697 (minidlna), uid 40002: exited on signal 11
Oct 30 05:45:17 FREENAS kernel: pid 70137 (minidlna), uid 40002: exited on signal 11
Oct 30 05:50:34 FREENAS kernel: pid 73599 (minidlna), uid 40002: exited on signal 11
Oct 30 05:55:50 FREENAS kernel: pid 77040 (minidlna), uid 40002: exited on signal 11
Oct 30 06:01:05 FREENAS kernel: pid 80496 (minidlna), uid 40002: exited on signal 11
Oct 30 06:06:24 FREENAS kernel: pid 83962 (minidlna), uid 40002: exited on signal 11
Oct 30 06:11:42 FREENAS kernel: pid 87408 (minidlna), uid 40002: exited on signal 11
Oct 30 06:17:00 FREENAS kernel: pid 90864 (minidlna), uid 40002: exited on signal 11
Oct 30 06:22:12 FREENAS kernel: pid 94301 (minidlna), uid 40002: exited on signal 11
Oct 30 06:27:30 FREENAS kernel: pid 97760 (minidlna), uid 40002: exited on signal 11
Oct 30 06:32:47 FREENAS kernel: pid 1310 (minidlna), uid 40002: exited on signal 11
Oct 30 06:38:03 FREENAS kernel: pid 4803 (minidlna), uid 40002: exited on signal 11
Oct 30 06:43:20 FREENAS kernel: pid 8243 (minidlna), uid 40002: exited on signal 11
Oct 30 06:48:38 FREENAS kernel: pid 11723 (minidlna), uid 40002: exited on signal 11
Oct 30 06:53:53 FREENAS kernel: pid 15164 (minidlna), uid 40002: exited on signal 11
Oct 30 06:59:10 FREENAS kernel: pid 18620 (minidlna), uid 40002: exited on signal 11
Oct 30 07:04:27 FREENAS kernel: pid 22086 (minidlna), uid 40002: exited on signal 11
Oct 30 07:09:44 FREENAS kernel: pid 25529 (minidlna), uid 40002: exited on signal 11
Oct 30 07:14:59 FREENAS kernel: pid 28986 (minidlna), uid 40002: exited on signal 11
Oct 30 07:20:18 FREENAS kernel: pid 32426 (minidlna), uid 40002: exited on signal 11
Oct 30 07:25:33 FREENAS kernel: pid 35889 (minidlna), uid 40002: exited on signal 11
Oct 30 07:30:49 FREENAS kernel: pid 39335 (minidlna), uid 40002: exited on signal 11
Oct 30 07:36:05 FREENAS kernel: pid 42778 (minidlna), uid 40002: exited on signal 11
Oct 30 07:41:22 FREENAS kernel: pid 46225 (minidlna), uid 40002: exited on signal 11
Oct 30 07:46:37 FREENAS kernel: pid 49671 (minidlna), uid 40002: exited on signal 11
Oct 30 07:51:56 FREENAS kernel: pid 53124 (minidlna), uid 40002: exited on signal 11
Oct 30 07:57:11 FREENAS kernel: pid 56565 (minidlna), uid 40002: exited on signal 11
Oct 30 08:02:28 FREENAS kernel: pid 60021 (minidlna), uid 40002: exited on signal 11
Oct 30 08:07:44 FREENAS kernel: pid 63493 (minidlna), uid 40002: exited on signal 11
Oct 30 08:13:00 FREENAS kernel: pid 66933 (minidlna), uid 40002: exited on signal 11
Oct 30 08:18:21 FREENAS kernel: pid 70389 (minidlna), uid 40002: exited on signal 11
Oct 30 08:23:34 FREENAS kernel: pid 73854 (minidlna), uid 40002: exited on signal 11
Oct 30 08:28:50 FREENAS kernel: pid 77310 (minidlna), uid 40002: exited on signal 11
Oct 30 08:34:09 FREENAS kernel: pid 80747 (minidlna), uid 40002: exited on signal 11
Oct 30 08:39:27 FREENAS kernel: pid 84203 (minidlna), uid 40002: exited on signal 11
Oct 30 08:44:44 FREENAS kernel: pid 87649 (minidlna), uid 40002: exited on signal 11
Oct 30 08:50:01 FREENAS kernel: pid 91105 (minidlna), uid 40002: exited on signal 11
Oct 30 08:55:14 FREENAS kernel: pid 94546 (minidlna), uid 40002: exited on signal 11
Oct 30 09:00:33 FREENAS kernel: pid 98008 (minidlna), uid 40002: exited on signal 11
Oct 30 09:05:49 FREENAS kernel: pid 1582 (minidlna), uid 40002: exited on signal 11
Oct 30 09:11:07 FREENAS kernel: pid 5058 (minidlna), uid 40002: exited on signal 11
Oct 30 09:16:26 FREENAS kernel: pid 8511 (minidlna), uid 40002: exited on signal 11
Oct 30 09:21:42 FREENAS kernel: pid 11957 (minidlna), uid 40002: exited on signal 11
Oct 30 09:26:56 FREENAS kernel: pid 15414 (minidlna), uid 40002: exited on signal 11
Oct 30 09:32:12 FREENAS kernel: pid 18854 (minidlna), uid 40002: exited on signal 11
Oct 30 09:37:30 FREENAS kernel: pid 22316 (minidlna), uid 40002: exited on signal 11
Oct 30 09:42:47 FREENAS kernel: pid 25756 (minidlna), uid 40002: exited on signal 11
Oct 30 09:48:07 FREENAS kernel: pid 29213 (minidlna), uid 40002: exited on signal 11
Oct 30 09:53:19 FREENAS kernel: pid 32654 (minidlna), uid 40002: exited on signal 11
Oct 30 09:58:38 FREENAS kernel: pid 36147 (minidlna), uid 40002: exited on signal 11
Oct 30 10:03:53 FREENAS kernel: pid 39597 (minidlna), uid 40002: exited on signal 11
Oct 30 10:09:12 FREENAS kernel: pid 43037 (minidlna), uid 40002: exited on signal 11
Oct 30 10:14:28 FREENAS kernel: pid 46489 (minidlna), uid 40002: exited on signal 11
Oct 30 10:19:49 FREENAS kernel: pid 49939 (minidlna), uid 40002: exited on signal 11
Oct 30 10:25:01 FREENAS kernel: pid 53380 (minidlna), uid 40002: exited on signal 11
Oct 30 10:30:20 FREENAS kernel: pid 56836 (minidlna), uid 40002: exited on signal 11
Oct 30 10:35:37 FREENAS kernel: pid 60282 (minidlna), uid 40002: exited on signal 11
Oct 30 10:40:53 FREENAS kernel: pid 63735 (minidlna), uid 40002: exited on signal 11
Oct 30 10:46:08 FREENAS kernel: pid 67175 (minidlna), uid 40002: exited on signal 11
Oct 30 10:51:26 FREENAS kernel: pid 70631 (minidlna), uid 40002: exited on signal 11
Oct 30 10:56:40 FREENAS kernel: pid 74086 (minidlna), uid 40002: exited on signal 11
Oct 30 11:01:58 FREENAS kernel: pid 77534 (minidlna), uid 40002: exited on signal 11
Oct 30 11:07:13 FREENAS kernel: pid 81000 (minidlna), uid 40002: exited on signal 11
Oct 30 11:12:33 FREENAS kernel: pid 84446 (minidlna), uid 40002: exited on signal 11
Oct 30 11:17:51 FREENAS kernel: pid 87902 (minidlna), uid 40002: exited on signal 11
Oct 30 11:23:03 FREENAS kernel: pid 91343 (minidlna), uid 40002: exited on signal 11
Oct 30 11:28:21 FREENAS kernel: pid 94796 (minidlna), uid 40002: exited on signal 11
Oct 30 11:33:36 FREENAS kernel: pid 98260 (minidlna), uid 40002: exited on signal 11
Oct 30 11:38:52 FREENAS kernel: pid 1824 (minidlna), uid 40002: exited on signal 11
Oct 30 11:44:14 FREENAS kernel: pid 5314 (minidlna), uid 40002: exited on signal 11
Oct 30 11:49:32 FREENAS kernel: pid 8755 (minidlna), uid 40002: exited on signal 11
Oct 30 11:54:44 FREENAS kernel: pid 12249 (minidlna), uid 40002: exited on signal 11
Oct 30 11:59:58 FREENAS kernel: pid 15705 (minidlna), uid 40002: exited on signal 11
Oct 30 12:05:16 FREENAS kernel: pid 19124 (minidlna), uid 40002: exited on signal 11
Oct 30 12:10:34 FREENAS kernel: pid 22579 (minidlna), uid 40002: exited on signal 11
Oct 30 12:15:50 FREENAS kernel: pid 26025 (minidlna), uid 40002: exited on signal 11
Oct 30 12:21:18 FREENAS kernel: pid 29466 (minidlna), uid 40002: exited on signal 11
Oct 30 12:26:23 FREENAS kernel: pid 32938 (minidlna), uid 40002: exited on signal 11
Oct 30 12:31:40 FREENAS kernel: pid 36390 (minidlna), uid 40002: exited on signal 11
Oct 30 12:36:56 FREENAS kernel: pid 39835 (minidlna), uid 40002: exited on signal 11
Oct 30 12:42:14 FREENAS kernel: pid 43265 (minidlna), uid 40002: exited on signal 11
Oct 30 12:47:32 FREENAS kernel: pid 46741 (minidlna), uid 40002: exited on signal 11
Oct 30 12:52:44 FREENAS kernel: pid 50189 (minidlna), uid 40002: exited on signal 11
Oct 30 12:58:01 FREENAS kernel: pid 53621 (minidlna), uid 40002: exited on signal 11
Oct 30 13:03:34 FREENAS kernel: pid 57082 (minidlna), uid 40002: exited on signal 11
Oct 30 13:08:36 FREENAS kernel: pid 60561 (minidlna), uid 40002: exited on signal 11
Oct 30 13:13:51 FREENAS kernel: pid 63995 (minidlna), uid 40002: exited on signal 11
Oct 30 13:19:12 FREENAS kernel: pid 67473 (minidlna), uid 40002: exited on signal 11
Oct 30 13:24:24 FREENAS kernel: pid 70895 (minidlna), uid 40002: exited on signal 11
Oct 30 13:29:43 FREENAS kernel: pid 74360 (minidlna), uid 40002: exited on signal 11
Oct 30 13:35:02 FREENAS kernel: pid 77809 (minidlna), uid 40002: exited on signal 11
Oct 30 13:40:17 FREENAS kernel: pid 81270 (minidlna), uid 40002: exited on signal 11
Oct 30 13:45:33 FREENAS kernel: pid 84715 (minidlna), uid 40002: exited on signal 11
Oct 30 13:50:53 FREENAS kernel: pid 88164 (minidlna), uid 40002: exited on signal 11
Oct 30 13:56:07 FREENAS kernel: pid 91588 (minidlna), uid 40002: exited on signal 11
Oct 30 14:01:24 FREENAS kernel: pid 95403 (minidlna), uid 40002: exited on signal 11
Oct 30 14:06:39 FREENAS kernel: pid 98520 (minidlna), uid 40002: exited on signal 11
Oct 30 14:11:57 FREENAS kernel: pid 2075 (minidlna), uid 40002: exited on signal 11
Oct 30 14:17:17 FREENAS kernel: pid 5575 (minidlna), uid 40002: exited on signal 11
Oct 30 14:22:32 FREENAS kernel: pid 9003 (minidlna), uid 40002: exited on signal 11
Oct 30 14:27:46 FREENAS kernel: pid 12473 (minidlna), uid 40002: exited on signal 11
Oct 30 14:33:03 FREENAS kernel: pid 15899 (minidlna), uid 40002: exited on signal 11
Oct 30 14:38:23 FREENAS kernel: pid 19355 (minidlna), uid 40002: exited on signal 11
Oct 30 14:43:40 FREENAS kernel: pid 22873 (minidlna), uid 40002: exited on signal 11
Oct 30 14:49:05 FREENAS kernel: pid 26275 (minidlna), uid 40002: exited on signal 11
Oct 30 14:54:18 FREENAS kernel: pid 29748 (minidlna), uid 40002: exited on signal 11
Oct 30 14:59:29 FREENAS kernel: pid 33213 (minidlna), uid 40002: exited on signal 11
Oct 30 15:04:47 FREENAS kernel: pid 36694 (minidlna), uid 40002: exited on signal 11
Oct 30 15:10:05 FREENAS kernel: pid 40142 (minidlna), uid 40002: exited on signal 11
Oct 30 15:15:22 FREENAS kernel: pid 43655 (minidlna), uid 40002: exited on signal 11
Oct 30 15:20:33 FREENAS kernel: pid 47122 (minidlna), uid 40002: exited on signal 11
Oct 30 15:25:50 FREENAS kernel: pid 50579 (minidlna), uid 40002: exited on signal 11
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
I've followed all the steps that you've posted and it works but not properly. Now I can't watch anything to its end, because miniDLNA it's restarting all the time. it's so annoying. and I haven't been adding anything to that folder. Transmission is pointing to other folder so it's not related to that. It is just sharing the folder with subsonic. but I don't think it could affect it. I hope you manage to get the rescanning to work without killing the miniDLNA process soon. Meanwhile I will have to remove this tweak. How can I removed it properly?

I'm running FreeNAS 8.3-release.

thanks
Alex

Code:
Oct 30 01:38:31 FREENAS kernel: pid 10279 (minidlna), uid 40002: exited on signal 11
Oct 30 01:45:13 FREENAS kernel: pid 14009 (minidlna), uid 40002: exited on signal 11
Oct 30 01:51:47 FREENAS kernel: pid 17512 (minidlna), uid 40002: exited on signal 11
You must have something writing/appending/deleting to one of the folders being monitored by MiniDLNA. It's easy enough to disable the thing, just edit the rc.conf file and remove the scanmedia_enabled line and reboot. After that just delete the scanmedia file you created and type 'pkg_delete wait_on' to delete the installed package. You can leave wait_on installed, it takes up little room and you might come back to this in the near future.

If you want to figure out what is causing the changes, try the following...

1) Log into the jail
2) type 'ee testscan'
3) copy the code below into the new file and save it
4) type 'chmod +x testscan'
5) type './testscan'

The directory location where the changes are occuring should be popping up as changes occur. Press CTRL+C a few times to exit out.

Code:
#!/bin/sh
#Testcode

  while :; do
   directories=$(find /media -type d -print0 | xargs -0 -I % echo -n '"%" ')
   echo "Monitoring the following directories: "$directories
   echo " "
   echo " "
   csh -c "wait_on -w -h $directories";
   echo " "
   echo " "
   sleep 2
  done



I wish I could generate something that would tell you the actual file names changing but I don't have the time to learn how to do that. Also, if you disable subsonic, does the problem go away? It would be nice to know.

If you turn off CIFS, does the problem go away?
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
I cannot define a different location for the folder '.wd_tv' created by the WDTVLive. So, as you said, I think I have found the best option for now. I'll keep an eye on this thread for future implementations of your already useful MiniDLNA Scan Fix. Thanks.
Is WDTV using the CIFS shares or DLNA only? What happens if you turn off CIFS (just for testing of course).

I'd like to track down the problem as finding a way to get a script or minidlna to rescan properly in FreeNAS looks like an impossible task.
 

Zendaug

Cadet
Joined
May 16, 2012
Messages
4
I'm in the same boat. Something is writing to my /media folder, but I don't know what. I tried the script suggested by joeschmuck, and it showed that just about every subdirectory was being written to. I disabled CIFS and most of the other services (except for Plugins, FTP, and SSH). I moved the Transmission download folder to outside of /media. Of the plugins, I also tried disabling Firefly and Transmission so that only Minidlna was left running. Yet, the script reveals that something is still writing to /media.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
I'm in the same boat. Something is writing to my /media folder, but I don't know what. I tried the script suggested by joeschmuck, and it showed that just about every subdirectory was being written to. I disabled CIFS and most of the other services (except for Plugins, FTP, and SSH). I moved the Transmission download folder to outside of /media. Of the plugins, I also tried disabling Firefly and Transmission so that only Minidlna was left running. Yet, the script reveals that something is still writing to /media.

You are using 8.3.0-Release with the correct plugins, I must assume so?

How about trying the test script again and disconnect the LAN cable. Does the problem still occur? I'm trying to figure out if this is internal to FreeNAS or external. If it's internal then it will not be as easy to figure out. If it's external then you would have to figure out which device is causing the problem, making a huge assumption it's not internet related. You could disable your internet but leave the FreeNAS item still plugging into the LAN as well.

One other thing you could try, and I know it's a real pain but you could delete the "Plugins" (the entire plugin setup), reinstall the main plugins software and reinstall only MiniDLNA and Wait_on, then run the test script again. That should make things happy again. If all is okay, load your other plugin's one at a time and test after each one has been loaded. I would reboot the computer after each plugin just to cover all your bases. If you choose this route, please post your results in gory detail :).

Thanks,
Mark
 

Alejometal

Dabbler
Joined
May 27, 2011
Messages
10
I've stopped everything (CIFS, s.m.a.r.t., SSH, transmission, subsonic) except for the plugin service and miniDNLA plugin, and it keeps rebooting miniDLNA like before (more or less every 5min). When I run the script it shows you a lot of folders inside your media folder, it is a huge list, but I think it is able to show me all of the them cause I might have more than 2000 folders in total. (I have my music and my video in that folder which is more than 600gb)

---
I've tried your script directly on the box with the Ethernet cable unplugged, and I'm still getting the same folders like before. BTW I'm running Freenas 8.3-release with the correct plugins, I've deleted and reinstalled the jail and the plugins after I've updated from 8.3-beta3.

I might try to make a clean installation of freenas on a virtual machine (VMware) to check if this issue also occurs there. I know this is not the same, but it is what I can do now.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
I too was thinking about doing some testing on my VM to see what might happen because I've never used transmission or any other plugins.

From what I understand, wait_on doesn't have a specified maximum limit of folders it can watch however I'm certain there is a number, I just don't know it. If you folds have that many folders, maybe you could change your mount point to a smaller section of directories to see if that helps. To be honest, I have 3 subdirectores however I have tested it to 6 deep. It would not be good it that became a limitation.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
I have noticed one problem that I have experienced in both my VM and real FreeNAS, I cannot add a multiple mount points to the same folder. In other words I cannot mount movies to /media and music to /media. /media will not list them properly. I ended up creating directories within /media to separate them out (/media/movies and /media/music) which now works.

I have created a full VM with MiniDLNA, Transmission, and FireFly plugins and still no problems for me. Maybe it does have something to do with too many files. If there is a limitation the script can be adjusted but if you have a huge music listing I would think these may need to be broken out, maybe alphabetically to make smaller segments to search.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
Try this out, I found out that wait_on has a limit on how many characters can be passed in the paths.
This will tell you the length of your directory paths.

once you create it you can 'chmod +x Testcode' and then run it './Testcode'

Code:
#!/bin/sh
#Testcode
directories=$(find /media -type d -print0 | xargs -0 -I % echo -n '"%" ')
echo "Checking String Length..."
echo " "
echo "Your directory string length is: "${#directories}
echo "The maximum string length permissible is 261649."
echo "If you are over the maximum then wait_on will not work."


Please post your results

-Mark
 

Alejometal

Dabbler
Joined
May 27, 2011
Messages
10
Try this out, I found out that wait_on has a limit on how many characters can be passed in the paths.
This will tell you the length of your directory paths.

once you create it you can 'chmod +x Testcode' and then run it './Testcode'

Please post your results

-Mark

this are the results:

Code:
plugins# ./Testcode                                                             
Checking String Length...                                                       
                                                                                
Your directory string length is: 152607                                         
The maximum string length permissible is 261649.                                
If you are over the maximum then wait_on will not work.                         
plugins# 


btw, related to what you have pointed out before about not being able to add multiple mount points onto the same zfs datasheet, (I've tested onto the same sama datasheet different folders specifically) I have experience'd it as well since I've tried 8.3.0-beta3. what I've experienced is that you can only have a mount point for miniDLNA in order to work properly.
 

Alejometal

Dabbler
Joined
May 27, 2011
Messages
10
I have good news and bad new.

First, the good ones, I've made it work by changing my mount point to another folder inside the old one which only have 134 files, 8 folders an 15gb. It's works as it's supposed to. I watched a video for 20min without interruptions, Then, I added a file to the folder which triggered the script which restarted miniDLNA. After that, I played the video again for 30min without a single issue. (transmission, subsonic cifs and other services were running at the same time)

Code:
/series

folder1
	-folder
		-14 files
	-file.mkv

folder2
	-folder
		-folder
			-2 files
		-folder
			-5 files
		-folder
			-3 files
		-folder
			-5 files
		
	-98 files


Bad news, it doesn't work with my complete folder. which has more than 500gb, around 30.000 files and more than 3000 folders. Most of those files and folders are music which actually are not necessary for me to get access through miniDLNA, but which I need to be in that folder.

The other thing that I've noticed is that when I used the "new" mount point, it didn't show me anything on the console when the script killed miniDLNA, contrary to what I get when It is restarting miniDLNA every 5min:

Code:
Nov  1 22:27:40 FREENAS kernel: pid 2898 (minidlna), uid 40002: exited on signal 11
Nov  1 22:36:56 FREENAS kernel: pid 6804 (minidlna), uid 40002: exited on signal 11
Nov  1 22:44:27 FREENAS kernel: pid 10340 (minidlna), uid 40002: exited on signal 11


-AlejoMetal
 

Alejometal

Dabbler
Joined
May 27, 2011
Messages
10
I've removed my music folder from the mount point folder and the script now is working properly. My new mount point contains 361GB, 2286 Files and 149 Folders. My music folder (179GB, 38824 Files and 3.204 Folders).

I can point out that the issue here is related to a limit that miniDLNA must have to handle a certain number of files and/or folder. I remember that before using your script I was already having issues with miniDLNA which wasn't able to retrieve my complete media library living big amount of folders without being shown.

I used to have the following, into the media directory: Movies, Music, Series, Videos and I wasn't being able to get access to the series and videos folders, and one third or more of the folder into the music folder weren't shown. It was making me crazy. So I changed the name of the folder to 1.Movies, 2.Series, 3.Videos 4.Music and it "solved" my problem because I wasn't really interested in getting access to my music through miniDLNA (for that I have subsonic).

-AlejoMetal
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
@ Alejometal
I'm glad you figured out the problem. It certainly wasn't the limitation I noticed for the wait_on function.

I will be adjusting the script so it will notify the user when the folder string length is approaching the maximum length, I just need to figure out how to get the message to the user is all. I'd like to use an email message or the Alert indicator but those will not be easy to incorporate. I could create a log file of sorts and force MiniDLNA to turn off as the indication. It's a crappy way to do it but if someone has a better idea I'm listening.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
I've removed my music folder from the mount point folder and the script now is working properly. My new mount point contains 361GB, 2286 Files and 149 Folders. My music folder (179GB, 38824 Files and 3.204 Folders).

I can point out that the issue here is related to a limit that miniDLNA must have to handle a certain number of files and/or folder. I remember that before using your script I was already having issues with miniDLNA which wasn't able to retrieve my complete media library living big amount of folders without being shown.

I used to have the following, into the media directory: Movies, Music, Series, Videos and I wasn't being able to get access to the series and videos folders, and one third or more of the folder into the music folder weren't shown. It was making me crazy. So I changed the name of the folder to 1.Movies, 2.Series, 3.Videos 4.Music and it "solved" my problem because I wasn't really interested in getting access to my music through miniDLNA (for that I have subsonic).

-AlejoMetal

Why not use a different directory for your music files like /music instead of /media/4.Music, or you could use a different directory for the videos as well like '/video' and then make appropriate changes to link all the files properly? That would separate the music and video files all together within the jail.
 

Alejometal

Dabbler
Joined
May 27, 2011
Messages
10
Why not use a different directory for your music files like /music instead of /media/4.Music, or you could use a different directory for the videos as well like '/video' and then make appropriate changes to link all the files properly? That would separate the music and video files all together within the jail.

Well first at all "/media" is not a directory is a ZFS datasheet, I need all my media in the same datasheet to be reachable by Subsonic with just one mount point. Furthermore, I've rearranged my directory already.

so my actual set-up is: (/media which is a datasheet) (I've also change the mount point for miniDLNA to "...../media/videos" )

Code:
"/media"
	Music
	Playlists
	Videos
		Movies
		Music-Videos
		Series
		Amine


So what I was actually telling you is that miniDLNA and your Script is working fine with 361GB, 2286 Files and 149 Folders so far. It would be nice to know what is the maximum number of folders and/or files which miniDLNA can work with.

-AlejoMetal
 
Status
Not open for further replies.
Top