FreeNAS 11, Sabnzbd, Couchpotato & Sonarr

Status
Not open for further replies.

Christopher Joyson

Contributor
Joined
May 22, 2014
Messages
105
Has anyone made a complete tutorial on the install of plugins from the GUI, i.e clicking on the plugins and letting them install themselves in FreeNAS 11.

I had mine running in FreeNAS 9.3 but cannot keep them going in FreeNAS 11.

I am Running FreeNAS-11.1-RELEASE. Address 192.168.0.21

How I set mine up

I have a jails Dataset “Jailset” . in Jails Configuration I have “/mnt/Nas_Volume/Jailset”.

Ip4 Network “192.168.0.0/24”

Network Start Address “192.168.0.30”

Network End Address “192.168.0.40”

Collection URL: http://download.freenas.org/latest/RELEASE/x64/jails

So I set up the Plugins by Doing SABNZBD First, the address SABNZBD takes is “http://192.168.0.30:8080/sabnzbd/”. I then make two Storage points:

Source “/mnt/Nas_Volume/Media/Complete” Destination “/media/Complete” for Completed Downloads

Source “/mnt/Nas_Volume/Media/NZB” Destination “/media/NZB” for Manually downloaded NZB files.

Then I Add Sonarr Via the plugins Tab Sheet.

The address Sonarr takes is http://192.168.0.31:8989/. I then make two Storage points:

Source “/mnt/Nas_Volume/Media/TV_Shows “, Destination “/media/TV_Shows” for my TV Shows folder

Source “/mnt/Nas_Volume/Media/Complete” Destination “/media/Complete” for completed files from SABNZBD.

Finally I added Couchpotato via the plugins tab:

The address Couchpotato takes is http://192.168.0.32:5050/. I then make two Storage points:

Source “/mnt/Nas_Volume/Media/Movies “, Destination “/media/Movies” for my Movie folder

Source “/mnt/Nas_Volume/Media/Complete” Destination “/media/Complete” for completed files from SABNZBD.

I have assigned user group and user name “Media” with an UID as 816 as I could not assign “media” as this is already taken.

After I have made the jails I then go to storage and assign the individual jails to “Media” not the whole “Jailset”. I give the Owner , Group, Other to all access Read, Write & Execute.

So the problem is I get them to work, but they are not as good as they were before, and after a couple of days they stop by themselves and don’t restart, sometimes it all of them, sometimes is just one or two.

When I tr to restart through the GUI nothing happens when I try through the shell I get
Code:
root@sonarr_1:/ # service sonarr start										
Starting sonarr.															  
login class 'daemon' non-existent, using default								
su: pam_start: system error													
/usr/local/etc/rc.d/sonarr: WARNING: failed to start sonarr					
root@sonarr_1:/ #

Does anyone know where I’m going wrong.

I know they say doing the same thing over and over again and expecting a different result is the definition of insane, and this is definitely sending me insane.
 
Last edited by a moderator:
Joined
Jan 7, 2015
Messages
1,155
Here is a good guide for installing everything to a vanilla jail. I cant help you with the plugins, but if you wanted to do something along the lines of the guide I can help you. IMHO its much better in the long run to go this route and to help make upgrading easier. They way you are trying to go sounds like a nightmare.
 

Christopher Joyson

Contributor
Joined
May 22, 2014
Messages
105
Hi

Thanks for that, however that’s a bit beyond my in the coding stakes. I was wanting something that uses the plugins, after all they are all included in the Freenas GUI.
I have tried many times to uses the plugins each in thier own jail, bt they only seem to work fro a short while.

I know some of the FreeBSD and linux masters may frown on me , but surely the plugin and individual jails is the way that itsdesigned. The Freenas team appear to besimplifying it but, it also seems asthough nobody supoorts the individual jail route.
allim after is some guidance on doing this.
 

Bibi40k

Contributor
Joined
Jan 26, 2018
Messages
136
Here is a good guide for installing everything to a vanilla jail. I can't help you with the plugins, but if you wanted to do something along the lines of the guide I can help you. IMHO its much better in the long run to go this route and to help make upgrading easier. They way you are trying to go sounds like a nightmare.
Hi, i'm interested in following your great tutorial on FreeNAS-11.1-U2.

I tried to but from the very beginning i found differences so a little help would be much appreciated.
1. what are the new settings for the jail (there's no vanilla and no type: pluginjail)
2. then is this "Ports Collection support for your FreeBSD version has ended, and no ports are guaranteed to build on this system. Please upgrade to a supported release." I read i can ignore that with "ALLOW_UNSUPPORTED_SYSTEM." but there are already too many deviations from your guide and i quit ...

So, thank you in advance
 
Joined
Jan 7, 2015
Messages
1,155
It wasnt my guide, just one I often had people follow as it was in fact mostly complete as far as the softwares included, but there were a few things that didnt mesh. But you are quite right a new one is needed as jails are moving to iocage, which I am quite a bit getting used to. Ill see if I can get something new written up for you as I just did a complete migration to iocage and it hasnt really been that fun. Plex has been the roughest, but the others are about as easy as always.

You will want to use iocage and not warden for jail management going forward.
 
Joined
Jan 7, 2015
Messages
1,155
Activate iocage on desired pool. This first set of commands should be done at a Freenas HOST ssh session.
Code:
iocage activate POOL

This should be the pool that you will want your jail info stored, in my case I have my jails on SSD’s, iocage uses the only pool if there is only one.

Now you will want to get the latest FreeBSD release. At the time of this writing, its 11.1-RELEASE
Code:
iocage fetch -r 11.1-RELEASE


Now we can create our jail(s). You can use whatever name you want. Match the Ethernet adapter and IP scheme to your network.
Code:
iocage create -n SABNZB -r 11.1-RELEASE ip4_addr="em0|192.168.1.232/24" boot=”on” allow_raw_sockets=”1”


Now start your new jail.
Code:
iocage start SABNZB


At this point you can add your storage to the jail. Your media and or downloads directories. For this I will illustrate how to add the fstab entries and finally show you what my fstab looks like. This FSTAB file is located in the jail root ex. /mnt/iocage/jails/SABNZB as is the other jail config file (config.json) these can be edited from the FreeNAS host. I like to use the /media directory for my mounts across all jails so these directories will need to be created for simplicity. Your mileage may vary, change to fit your use.
Code:
cd /mnt/iocage/jails/SABNZB/root/media
mkdir movies tv docs music download backup

Now add your FSTAB entries. These will always vary. Ill give you an example of how to add them and then show you my /mnt/iocage/jails/SABNZB/fstab file.
Code:
iocage fstab -a SABNZB "/mnt/zfs1/download/ /media/download nullfs rw 0 0"

Add your needed directories one by one or use my example fstab and make the edits manually. This route will need a jail restart.
Code:
nano /mnt/iocage/jails/SABNZB/fstab

Mine looks like this: Remember the directories we created earlier? Use these as your mount points!!
/mnt/iocage/jails/SABNZB/fstab
Code:
/mnt/zfs1/download/	  /mnt/iocage/jails/SABNZB/root/media/download nullfs rw	 0	  0
/mnt/zfs1/backup/	 /mnt/iocage/jails/SABNZB/root/media/backup		nullfs rw	 0	 0
/mnt/zfs1/video/Movies/ /mnt/iocage/jails/SABNZB/root/media/movies		nullfs rw	 0	 0
/mnt/zfs1/video/TV/ /mnt/iocage/jails/SABNZB/root/media/tv	nullfs rw	 0	 0
/mnt/zfs1/audio/	 /mnt/iocage/jails/SABNZB/root/media/music	nullfs rw	 0	 0

Now you can enter your new jail in multiple ways iocage console or using jexec like always. As I am a longtime user, I prefer jexec. Use jls first to see all jails on the system. Then jexec to enter the jail.
Code:
jls
jexec # csh

Now you will be sitting at a root command prompt inside the new jail. First thing first get everything updated and ready to go. For simplicity ill give it all in one command. You can basically answer yes to everything.
Code:
pkg update && pkg upgrade && portsnap fetch extract

Now we get to the meat of it. These steps will create your user. This should be a common user who already owns your main FreeNAS datasets. For me this user is JBD and group media, yours will vary. People make this part too complicated and this is where permissions issues arise. I DO NOT have permissions issues between all these softwares, and multiple jails. But only I use this server. The real trick is to give this user the same uid, and group as the FreeNAS host user. I have highlighted the important questions here.
Code:
adduser
USER (dataset owner)
GROUP (dataset owner)
UID (same as dataset owner)
NO PASSWORD LOGIN

Now we give this user ownership of our created mountpoints.
Code:
chown USER:GROUP /media/*

We can now go ahead and get our softwares installed. I put all of these “like” softwares together in one jail, if you want multiple jails, just rinse and repeat. In this case it will be SAB, CP, HP, and Sonarr
Code:
pkg install python py27-sqlite3 fpc-libcurl docbook-xml git-lite nano portmaster
cd /usr/local
ln -s /usr/local/bin/python /usr/bin/python
git clone https://github.com/CouchPotato/CouchPotatoServer.git
cp CouchPotatoServer/init/freebsd /usr/local/etc/rc.d/couchpotato
chmod 555 /usr/local/etc/rc.d/couchpotato

Now what we want to do is run all of these softwares as the same created user/group we made earlier. We set this in the /etc/rc.conf file.
Code:
sysrc couchpotato_enable=YES
sysrc couchpotato_user=USER
sysrc couchpotato_group=GROUP
chown -R USER:GROUP /usr/local/CouchPotatoServer
service couchpotato start

We should now have couchpotato up and running on http://JAILIP:5050

Then we install Headphones.
Code:
cd /usr/local && git clone git://github.com/rembo10/headphones.git
chown -R USER:GROUP headphones
cp /usr/local/headphones/init-scripts/init.freebsd /usr/local/etc/rc.d/headphones
chmod +x /usr/local/etc/rc.d/headphones
sysrc headphones_enable=YES
sysrc headphones_user=USER
sysrc headphones_group=GROUP

If memory serves in order to run headphones you have to specify the jail IP or it only listens on localhost. This may or may not be accurate now. My HP config has this line customhost = 192.168.111.114 If this does turn out to be the case where HP starts but cant be accessed, you can edit the config file. Also me thinks the host can be 0.0.0.0 and it listens on all IPs.

Edit: After further review it was SABNZB that needed to have the ip changed from 127.0.0.1 to 0.0.0.0 This can be skipped
Code:
nano /usr/local/headphones/config.ini

Change the customhost line to your jail IP. Now when we run service headphones start we should have it on http://JAILIP:8181

Now we can install the easy ones. This is done in the more normal way.
Code:
pkg install sabnzbdplus sonarr
chown -R USER:GROUP /usr/local/sabnzbd && chown -R USER:GROUP /usr/local/sonarr
sysrc sabnzbd_enable=YES
sysrc sabnzbd_user=USER
sysrc sabnzbd_group=GROUP
sysrc sonarr_enable=YES
sysrc sonarr_user=USER
sysrc sonarr_group=GROUP
service sonarr start

Now we need to change the listen ip in the sab config. It is located at /usr/local/sabnzbd/sabnzbd.ini So.
Code:
nano /usr/local/sabnzbd/sabnzbd.ini

Change instance of 127.0.0.1 to either your jail IP or simply 0.0.0.0. CTRL+X to save. Now do
Code:
service sabnzbd start


We should have sab on port 8080 and sonarr on 8989. Everything should be now running as USER.

Lastly I like to upgrade using ports, not always, but often new releases are in the port tree before pkg.
Code:
portsnap fetch update && portmaster -aBd


After all this is done, exit the jail and reboot the jail.
Code:
exit
iocage restart SABNZB

Everything *should be up and running, if there are any hiccups, this is where you will see them. Report anything hokey from the output.

Now you can go to the individual http://JAILIP:PORT to configure all of these. If this was followed all of your media will be located centrally to all of these softwares in /media -- of who the USER owns and these softwares all run as.

I threw this together so there could be things I overlooked or missed. I did not do this as I typed. I did it mainly from memory. If you post here with problems ill try to answer quickly.. Good luck, let me know how it goes. Inform me if I need make edits to this post for anyone else who comes along. But this should be pretty close.
 
Last edited:
Joined
Jan 7, 2015
Messages
1,155
Sure thing. We're you able to try this?
 

Bibi40k

Contributor
Joined
Jan 26, 2018
Messages
136
Not yet. Priority now is to hack a AppleTV 3 with PlexConnect
 

Christopher Joyson

Contributor
Joined
May 22, 2014
Messages
105
HI

I tried this however I've had a bit of a poor start: on your line

iocage create -n SABNZB -r 11.1-RELEASE ip4_addr="em0|192.168.1.232/24" boot=”on” allow_raw_sockets=”1”

I should have had an network interface of "igb0" however I used your example of "em0" how can I change this?
 

Christopher Joyson

Contributor
Joined
May 22, 2014
Messages
105
Joined
Jan 7, 2015
Messages
1,155
Exactly, good job.
 

Christopher Joyson

Contributor
Joined
May 22, 2014
Messages
105
Ooops stuck again this time on
jexec -u root SABNZB csh
I get:
jexec jail "SABNZB" not found

However I tries iocage console SABNZB and found I was in "root@SABNZB:~ #''

tried "pkg update && pkg upgrade && portsnap fetch extract"
recived thefinal result "A pre-built version of pkg culd not befound for your system"
 

Christopher Joyson

Contributor
Joined
May 22, 2014
Messages
105
I tried pingning from inside the console and recieved no replies from the Jail address or even my default gateway. However pining into the jailfrom outside recieved a reply.
 
Joined
Jan 7, 2015
Messages
1,155
pkg upgrade is all that is truly needed but the jail will need to be able to see the internet. Try iocage restart SABNZB
 

Christopher Joyson

Contributor
Joined
May 22, 2014
Messages
105
Hii
Ive Restarted SABNZB

Checked vnet

[root@freenas ~]# iocage get vnet SABNZB

vnet is off

I had set also the default gateway

iocage set defaultrouter=192.168.0.1 SABNZB

this is the output from

iocage exec SABNZB ifconfig

Code:
igb0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500	
	   options=6403bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCS
UM,TSO4,TSO6,VLAN_HWTSO,RXCSUM_IPV6,TXCSUM_IPV6>								
	   ether d0:50:99:c0:ab:b8												
	   hwaddr d0:50:99:c0:ab:b8												
	   inet 192.168.1.30 netmask 0xffffff00 broadcast 192.168.1.255			
	   media: Ethernet autoselect (1000baseT <full-duplex>)					
	   status: active														
igb1: flags=8c02<BROADCAST,OACTIVE,SIMPLEX,MULTICAST> metric 0 mtu 1500		
	   options=6403bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCS
UM,TSO4,TSO6,VLAN_HWTSO,RXCSUM_IPV6,TXCSUM_IPV6>								
	   ether d0:50:99:c0:ab:b9												
	   hwaddr d0:50:99:c0:ab:b9												
	   media: Ethernet autoselect											
	   status: no carrier													
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384			 
	   options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>				 
	   groups: lo	 
Code:


I have restarted the jail a few time to no avail.
 
Last edited:
Joined
Jan 7, 2015
Messages
1,155
You only need to set gateway when vnet is used.
 

Christopher Joyson

Contributor
Joined
May 22, 2014
Messages
105
So what I have done up to now is get to the point when I have done the entries for fstab.

Unfortunately I had done a mis type and had TV-Shows instead of TV_Shows. So I changed fstab to show TV_Shows and noticed that in /root/media I had a new folder TV-Shows.

Code:

/mnt/Nas_Volume/Media/Movies/  /mnt/iocage/jails/SABNZB/root/media/Movies	  nullfs  rw	  0	   0 # Added by iocage on 2018-

/mnt/Nas_Volume/Media/TV_Shows/ /mnt/iocage/jails/SABNZB/root/media/TV_Shows    nullfs  rw	  0	  0 # Added by iocage on 2018-

/mnt/Nas_Volume/Media/NZB/	  /mnt/iocage/jails/SABNZB/root/media/NZB nullfs  rw	  0	  0 # Added by iocage on 2018-04-12 17

/mnt/Nas_Volume/Media/Music/    /mnt/iocage/jails/SABNZB/root/media/Music	   nullfs  rw	  0	   0 # Added by iocage on 2018-

/mnt/Nas_Volume/Media/Downloads/	    /mnt/iocage/jails/SABNZB/root/media/Downloads   nullfs  rw	  0	   0 # Added by iocage



I checked this folder and it was full of my TV series. But TV_Shows was not.

I then did:

iocage restart SABNZB

This resulted in TV_ shows being populated with my TV series.

So I felt safe to delete everything from TV-Shows and try and delete TV-shows.

I eventually removed TV-shows and checked TV_Shows whether my files were still there, which they were.

I was very happy at this point. I had also removed my old style jails altogether without a problem.

In preparation for the next part of adding Users I made sure all my directories had the right Owners and groups.

Code:

-rwxrwxr-x+   1 nobody  Users	  0 Nov  4 14:50 .windows					 

drwxrwxr-x+   2 nobody  Users	  2 Jan 15  2016 Automatically Add to iTunes   

drwxrwxr-x+   2 Media  Users	  2 Jun  7  2015 Backup						

drwxrwxr-x+   6 Media  Media	  6 Dec 11  2016 Concert_Videos				

drwxrwxr-x+   4 Media  Media	  4 Jan 31 16:35 Downloads					 

drwxrwxr-x+   2 Media  Media	  3 Dec 11 18:40 Logs						 

drwxrwxr-x+   2 Media  Media	  2 Apr 10 16:50 Movies						

drwxrwxr-x+ 277 Media   Media  17341 Jan 15  2017 Music						

drwxrwxr-x+ 176 Media   Media	198 Jan  4  2017 Music_Videos				 

drwxrwxr-x+   2 Media  Media	  2 Jan  8 20:27 NZB						   

drwxrwxr-x+   2 Media  Media	  4 Dec 18 17:41 plugins					   

drwxrwxr-x+   2 Media  Media	  7 Dec 22  2016 scripts					   

drwxrwxr-x+   2 Media  Media	  2 Apr 13 11:58 TV_Shows 




Then to add my user

Inside Console SABNZB

adduser

The final result was as below as Ilost the Questions and answers over the top of my shell window

(going through the GUI shell window is the only way I know to enter commands)

Code:

Username : Media

Password : <disabled>

Full Name : Chris_Joyson

Uid : 816

Class :

Groups : Media

Home : Mnt/Nas_Volume/Media

Home Mode : Shell : /bin/sh

Locked : no

OK? (yes/no):yes



A night passed so I started again this morning, but during the night we had a swap round the gadget corner (TV, Cable etc and the Freenas box) so the Freenas box was switched off for the night.

So I started again but as I had done all of the above with checking and changing of the users and Groups, so I thought I’d check my media folders via windows. Everything was empty, with no backups (silly me but I don’t have any large Drives to backup to).

My Movies folder was Empty both on mnt/Nas_Volume/media and also on mnt/iocage/jails/SABNZB/root/media.

Now I’m not that bothered as my internet speed is good enough to get everything back quick, if I remember everything, that is.

But where have I gone wrong I’m not going to proceed with the rest, could I have deleted them through

rmdir -rf TV-Shows I certainly did not ask for any sort of delete on my movies/
 
Joined
Jan 7, 2015
Messages
1,155
But where have I gone wrong I’m not going to proceed with the rest, could I have deleted them through

rmdir -rf TV-Shows I certainly did not ask for any sort of delete on my movies/
No, it makes no sense the rmdir command wont allow a -rf it will return an illegal option. If you issue rmdir with out flags on a directory with contents, it will return 'not empty'. The rmdir command can generally only be used on an empty directory. However rm -rf TV-Shows is a different animal and would certainly wreak havok if issued on the wrong directory. And if you issued that command by accident on the wrong directories, then yeah, some things might be gone.
 

Christopher Joyson

Contributor
Joined
May 22, 2014
Messages
105
Yes It was rm -rf TV-Shows . There is a possibility that I miss typed TV-Shows, however i did double check at each stage, but never Movies. So the loss of data in Movies does'nt make sense to me.
 
Status
Not open for further replies.
Top