Sonarr on FreeNAS instructions

Alright so I know a lot of people want Sonarr as a FreeNAS plugin. Well guess what? It’s pretty damn easy to setup manually. I’ll walk you through the unix commands, from there you’re on your own. Ready? Crack dem knuckles!

(NOTE: I did this with the latest version of FreeNAS (9.2.1.9))

  1. Create a new jail in FreeNAS, just the default settings, give it a name and create.

  2. Ok 2 options for this. Either SSH into your FreeNAS box, run ‘jls’ to find your jail #, and then ‘jexec # csh’ OR you can shell into your jail via the jails tab in the FreeNAS GUI. Either way you need to be sitting at a shell for your jail. The next steps are commands to run.

  3. pkg install nano

  4. pkg install mono

  5. pkg install mediainfo

  6. cd

  7. wget http://www.sqlite.org/2014/sqlite-autoconf-3080702.tar.gz

  8. tar -xzvf sqlite-autoconf-3080702.tar.gz

  9. cd sqlite-autoconf-3080702

  10. set CPPFLAGS="-DSQLITE_ENABLE_COLUMN_METADATA"

  11. ./configure CFLAGS=-DSQLITE_ENABLE_COLUMN_METADATA

  12. make

  13. make install

  14. cd

  15. wget http://download.sonarr.tv/v2/master/mono/NzbDrone.master.tar.gz

  16. tar -xzvf NzbDrone.master.tar.gz

  17. nano /etc/rc.d/run_drone

  18. /usr/local/bin/mono /root/NzbDrone/NzbDrone.exe --nobrowser &

  19. Hit Ctrl+X and then hit the ‘Y’ key.

  20. chmod 777 /etc/rc.d/run_drone

  21. Stop, and then start the jail in FreeNAS GUI. Hit up http://:8989 Should be good to go.

Notes: line 19 you will just be typing into a text editor, it’s not a command. Line 11 has a dot ‘.’ before the slash, you need that in the command. Hopefully I didn’t forget a random step I did. Let me know if it works.

3 Likes

This is awesome, thanks for writing it up!

What version of mono does this get you?

root@Sonarr:/ # mono -V
Mono JIT compiler version 3.10.0 (tarball Thu Nov 13 03:35:32 UTC 2014)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
	TLS:           __thread
	SIGSEGV:       altstack
	Notification:  kqueue
	Architecture:  amd64
	Disabled:      none
	Misc:          softdebug 
	LLVM:          supported, not enabled.
	GC:            sgen
root@Sonarr:/ #
1 Like

All set up for me and works when run manually with the command

/usr/local/bin/mono /root/NzbDrone/NzbDrone.exe --nobrowser

but obviously hogs the terminal

running

/usr/local/bin/mono /root/NzbDrone/NzbDrone.exe --nobrowser &

does not work and the process starts but the top command shows as the process being stopped.

neither command works when placed in /etc/rc.d/run_drone

I have played around with screen to see if i can get it working on boot but so far no avail.

running

screen -S sonarr_screen -d -m /usr/local/bin/mono /root/NzbDrone/NzbDrone.exe --nobrowser

or even adding that to run_drone and then executing

./run_drone

works and the system fires up and becomes accessible.

any ideas about getting it starting on boot with either technique?

Try my rc.d method again, but this time run: chmod 777 /etc/rc.d/run_drone After you make the script, or if it still exists just run that command and restart the jail. I forgot to add that step and it may be the cause of the issue. Let me know if it works so I can update the OP.

Edit: DEFINITELY don’t forget the ‘&’ at the end for the rc.d script, that can cause a no-boot. It’s easily fixable, but just to save you hassle up front :smile:

Hi there,

Appreciate the great walk through. I am using the same version of FreeNAS as you, but when I run the pkg install command, I get an error that no valid repository was found. Did you run in this as well, or did I miss something?

Thanks for any help!

Negative. pkg install has always worked right from a vanilla plugin jail. Odd that yours is running differently.

I did some digging on the FreeNAS site and apparently this is a know bug that is scheduled to be fixed in the 9.3 release.

I will keep digging.

Thanks!

Hope you’re right. If there’s one thing I’ve learned about FreeNAS is that fixing a bug is always in next release :smiley:

1 Like

perfect that seems to have got it.

I’m going to assume the system user didn’t have rights to run the rc.d script then and by 777 nuking it it’s allowed the system to finally call it properly.

I had that same bug with another jail of mine. It was fixable.

May not be the same issue exactly but for my issue this forum helped. https://forums.freenas.org/index.php?threads/cannot-use-pkg-install-on-new-plugin-jail-freenas-9-2-1.18319/

This advice in particular:

edit /usr/local/etc/pkg/repos/FreeBSD.conf
make the url http:// only (not pkg+http)
after this “pkg update”
"upgrade pkg"
edit the FreeBSD.conf file again and re-add the pkg+http part

apologies i can’t be more help i fixed it quite a while ago.

Awesome! Yeah I was writing the steps from memory and forgot that one, but it’s now added to the OP. One thing I’m going to work on now is crash detection and relaunch. Sonarr crashed on me after a few days and there’s no way to know until you access it. Otherwise I’m loving it, huge upgrade from Sickbeard.

@markus101 I added a wiki page for this so it doesn’t get lost in the forums:

Awesome, thanks! I see its linked from the installation page :thumbsup:

Anything in the logs? If it was during an update (logs something similar to Starting NzbDrone.Update) then its usually a permissions or related to starting mono up again.

I can’t remember when exactly it crashed, so I can’t find it in the logs at the moment. Next time I’ll check the logs when I bring it back up and let you know.

1 Like

Mine tends to hang crash on first library scan and most/all subsequent scans. Either that or i am being impatient. small scans of individual shows don’t cause it to hang/crash.

I too will check logs if i can.

Make sure you’re on the latest release, we recently fixed an issue with DB locks. Also check mediainfo for an update, if mediainfo wasn’t already scraped for a file it will be on rescan (we had some issues with an old version on Windows).

Ah I thought I was up to date, I was actually a few versions behind. All updated now. The GUI update doesn’t work for me, but just removing the old Nzbdrone directory and extracting the new version in works.

In what way doesn’t it work? It needs re-write permissions and has to be able to spawn an update process, which will terminate the existing version and spawn another in its place.

Updates is a pretty important piece, so we’d really like to solve it if we can.

Update process failed: ApplicationName=‘mono’, CommandLine=’/tmp/nzbdrone_update/NzbDrone.Update.exe 5282 /tmp/nzbdrone_update /root/NzbDrone/NzbDrone.exe’, CurrentDirectory=’’, Native error= Cannot find the specified file

Running as root so there shouldnt be any permission issues.