kjp4756 41 Posted January 7, 2016 Share Posted January 7, 2016 A not so pretty way to get a filename from a file descriptor is to use 'find /path/to/mountpoint -inum <inode number>' In freebsd there aren't too many options for getting a filename from a file descriptor. I'm assuming this is why auto-updates never worked on plex server for freebsd either. There's KERN_PROC_FILEDESC which appears to not work properly with regular files file descriptors. It works fine with directory file descriptors. https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=197695 Gotta love freebsd. I'm seriously leaning towards switching to linux now that zfs on linux is considered safe for production use. Link to comment Share on other sites More sharing options...
razzfazz 11 Posted January 8, 2016 Share Posted January 8, 2016 I've got it to the point where the logs look clean now; see this post: http://emby.media/community/index.php?/topic/13083-freenas-plugin/page-17&do=findComment&comment=284088 Link to comment Share on other sites More sharing options...
kjp4756 41 Posted January 8, 2016 Share Posted January 8, 2016 Wow, you sure are making some progress. I compiled mono with the one big commit you posted in the other thread. No errors at startup. I do get this as soon as I touched my movie directory 2016-01-08 01:26:13.1354 Error LibraryMonitor: Error in Directory watcher for: /media/Movies *** Error Report *** Version: 3.0.5785.0 Command line: /usr/local/lib/emby-server/MediaBrowser.Server.Mono.exe -ffmpeg /usr/local/bin/ffmpeg -ffprobe /usr/local/bin/ffprobe -programdata /var/db/mediabrowser Operating system: Unix 9.3.28.0 Processor count: 4 64-Bit OS: True 64-Bit Process: True Program data path: /var/db/mediabrowser Mono: 4.2.1 (Stable 4.2.1.124/39edf24 Fri Jan 8 01:18:50 UTC 2016) Application Path: /usr/local/lib/emby-server/MediaBrowser.Server.Mono.exe startIndex cannot be larger than length of string. Parameter name: startIndex System.ArgumentOutOfRangeException at System.String.Substring (Int32 startIndex, Int32 length) <0x800a06c10 + 0x0013f> in <filename unknown>:0 at System.String.Substring (Int32 startIndex) <0x803b7d730 + 0x0002c> in <filename unknown>:0 at System.IO.KqueueMonitor.PostEvent (FileAction action, System.String path, System.String newPath) <0x8144a8d40 + 0x00105> in <filename unknown>:0 at System.IO.KqueueMonitor.Monitor () <0x811dca410 + 0x005b9> in <filename unknown>:0 at System.IO.KqueueMonitor.DoMonitor () <0x811dc5f50 + 0x001e3> in <filename unknown>:0 2016-01-08 01:26:13.1354 Info LibraryMonitor: Stopping directory watching for path /media/Movies Link to comment Share on other sites More sharing options...
kjp4756 41 Posted January 8, 2016 Share Posted January 8, 2016 I had a TV show download while I was busy doing other things and noticed it was added to emby on its own. Library scan appears to be working on my TV shows. The movies library monitor crashed as soon as I did a 'touch /media/Movies' 2016-01-08 01:51:01.2672 Info LibraryMonitor: /media/TV/The Big Bang Theory/Season 9/The Big Bang Theory - S09E12.mp4.partial~ reports change. 2016-01-08 01:51:01.2672 Info LibraryMonitor: /media/TV/The Big Bang Theory/Season 9/The Big Bang Theory - S09E12.mp4 reports change. 2016-01-08 01:51:01.2672 Info LibraryMonitor: Season 9 (/media/TV/The Big Bang Theory/Season 9) will be refreshed. Link to comment Share on other sites More sharing options...
kjp4756 41 Posted January 8, 2016 Share Posted January 8, 2016 Library monitor works for movies now. Everything is OK as long as I don't use touch on any of my media folders. You probably just need to make some minor tweaks to the mono changes you did. I can live with it as is. Thanks a bunch. This is so much quicker than running a full library scan when 1 episode or movie is added. Link to comment Share on other sites More sharing options...
razzfazz 11 Posted January 8, 2016 Share Posted January 8, 2016 Yeah, you should trigger this exception with any changes to the root directory; should be an easy fix. Link to comment Share on other sites More sharing options...
razzfazz 11 Posted January 8, 2016 Share Posted January 8, 2016 (edited) Here we go: https://github.com/mono/mono/compare/mono:mono-4.2.1.124...razzfazz:mono-4.2.1.124-freebsd_fixes.diff Seems to be picking up changes ok now, and touching the root doesn't cause any more exceptions. Give it a shot and let me know how it works for you. EDIT: Update link. Edited January 9, 2016 by razzfazz Link to comment Share on other sites More sharing options...
kjp4756 41 Posted January 8, 2016 Share Posted January 8, 2016 Works good now; no more crashes when touching folders. Thanks again! Link to comment Share on other sites More sharing options...
kjp4756 41 Posted January 8, 2016 Share Posted January 8, 2016 Spoke too soon. After a few minutes all of the library monitors crashed. 2016-01-08 15:55:24.7516 Error LibraryMonitor: Error in Directory watcher for: /media/Movies *** Error Report *** Version: 3.0.5785.0 Command line: /usr/local/lib/emby-server/MediaBrowser.Server.Mono.exe -ffmpeg /usr/local/bin/ffmpeg -ffprobe /usr/local/bin/ffprobe -programdata /var/db/mediabrowser Operating system: Unix 9.3.28.0 Processor count: 4 64-Bit OS: True 64-Bit Process: True Program data path: /var/db/mediabrowser Mono: 4.2.1 (Stable 4.2.1.124/39edf24 Fri Jan 8 15:47:35 UTC 2016) Application Path: /usr/local/lib/emby-server/MediaBrowser.Server.Mono.exe System.Threading.ThreadAbortException at System.IO.KqueueMonitor.DoMonitor () <0x811db4510 + 0x00270> in <filename unknown>:0 at System.IO.KqueueMonitor.<Start>m__0 () <0x811db3ac0 + 0x00014> in <filename unknown>:0 at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) <0x80437cc10 + 0x00098> in <filename unknown>:0 at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, Boolean preserveSyncCtx) <0x80437c3c0 + 0x0021a> in <filename unknown>:0 at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, Boolean preserveSyncCtx) <0x80437bfc0 + 0x00028> in <filename unknown>:0 at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) <0x80437bc80 + 0x00061> in <filename unknown>:0 at System.Threading.ThreadHelper.ThreadStart () <0x80437bac0 + 0x00039> in <filename unknown>:0 2016-01-08 15:55:24.7516 Info LibraryMonitor: Stopping directory watching for path /media/Movies 2016-01-08 15:55:26.7498 Error LibraryMonitor: Error in Directory watcher for: /var/db/mediabrowser/data/playlists *** Error Report *** Version: 3.0.5785.0 Command line: /usr/local/lib/emby-server/MediaBrowser.Server.Mono.exe -ffmpeg /usr/local/bin/ffmpeg -ffprobe /usr/local/bin/ffprobe -programdata /var/db/mediabrowser Operating system: Unix 9.3.28.0 Processor count: 4 64-Bit OS: True 64-Bit Process: True Program data path: /var/db/mediabrowser Mono: 4.2.1 (Stable 4.2.1.124/39edf24 Fri Jan 8 15:47:35 UTC 2016) Application Path: /usr/local/lib/emby-server/MediaBrowser.Server.Mono.exe System.Threading.ThreadAbortException at System.IO.KqueueMonitor.DoMonitor () <0x811db4510 + 0x00270> in <filename unknown>:0 at System.IO.KqueueMonitor.<Start>m__0 () <0x811db3ac0 + 0x00014> in <filename unknown>:0 at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) <0x80437cc10 + 0x00098> in <filename unknown>:0 at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, Boolean preserveSyncCtx) <0x80437c3c0 + 0x0021a> in <filename unknown>:0 at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, Boolean preserveSyncCtx) <0x80437bfc0 + 0x00028> in <filename unknown>:0 at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) <0x80437bc80 + 0x00061> in <filename unknown>:0 at System.Threading.ThreadHelper.ThreadStart () <0x80437bac0 + 0x00039> in <filename unknown>:0 2016-01-08 15:55:26.7498 Info LibraryMonitor: Stopping directory watching for path /var/db/mediabrowser/data/playlists Link to comment Share on other sites More sharing options...
razzfazz 11 Posted January 8, 2016 Share Posted January 8, 2016 There still appears to be an issue where the monitor thread doesn't shut down cleanly and eventually gets aborted, which throws a ThrradAborted exception. Guessing it's because it's stuck inside the kevent syscall at the time. I'll play around with it some more. Link to comment Share on other sites More sharing options...
razzfazz 11 Posted January 8, 2016 Share Posted January 8, 2016 Wow, good timing. Link to comment Share on other sites More sharing options...
razzfazz 11 Posted January 8, 2016 Share Posted January 8, 2016 (edited) Try this: https://github.com/mono/mono/compare/mono:mono-4.2.1.124...razzfazz:mono-4.2.1.124-freebsd_fixes.diff EDIT: Update link. Edited January 9, 2016 by razzfazz Link to comment Share on other sites More sharing options...
kjp4756 41 Posted January 8, 2016 Share Posted January 8, 2016 Looks to be working fine now. No problems in the hour emby has been running with the new mono. 1 Link to comment Share on other sites More sharing options...
razzfazz 11 Posted January 8, 2016 Share Posted January 8, 2016 Yeah, seems to run smoothly here as well. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now