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

How to install SABnzbd in iocage jail and change permission to write to Freenas Pool owned by other user.

Joined
Feb 11, 2016
Messages
27
Thanks
2
#1
First time writing something up like this so forgive how poorly written and organized. I have been struggling getting a news reader off warden into iocage and to be fully functional. This seems to have done it.

This version is a lot different than the old warden plugin. I think the issues were mostly:
  • Can't get to web gui unless you edit .ini
  • Different user group ID than 816 than legacy version
  • Mount points I had to do 1 to 1. On old version i got away with just one mount point. this version I have 1 mount point for incomplete. and 1 for each category. Did this through web gui after pkg installed and operational with correct users. have to have correct users to confiugre sab and work.
/usr/local/sabnzbd/Downloads/complete/Movies​
/usr/local/sabnzbd/Downloads/complete/TV​
/usr/local/sabnzbd/Downloads/incomplete​


Make jail through webgui
Start the jail and go to shell from the right three dot selection area.

You have to enter this below and start and stop it otherwise you don't get .ini to edit

pkg install sabnzbdplus​
sysrc sabnzbd_enable="YES"​
service sabnzbd start​
service sabnzbd status​
service sabnzbd stop​
edit /usr/local/sabnzbd/sabnzbd.ini​


Go to line 85 to edit - host = 127.0.0.1 and change it to host = 0.0.0.0

service sabnzbd start​


At this point you can access the webgui.
But you should also change the user to have same number that owns your shares on freenas. If you don't you can't post process. I don't think it matters the name, just the number. in my case 816. What messed me up here originally was that media is my pool owner but the jail had that used already. so had to use a different name

pw useradd -n newmedia -u 816 -d /nonexistent -s /usr/sbin/nologin
chown -R newmedia:newmedia /usr/local/sabnzbd
sysrc 'sabnzbd_user=newmedia'
chown -R newmedia:newmedia /usr/local/share/sabnzbdplus
chown -R newmedia:newmedia /var/run/sabnzbd
service sabnzbd start

It seems to be working well.
 
Joined
Sep 21, 2014
Messages
59
Thanks
3
#2
First time writing something up like this so forgive how poorly written and organized. I have been struggling getting a news reader off warden into iocage and to be fully functional. This seems to have done it.

This version is a lot different than the old warden plugin. I think the issues were mostly:
  • Can't get to web gui unless you edit .ini
  • Different user group ID than 816 than legacy version
  • Mount points I had to do 1 to 1. On old version i got away with just one mount point. this version I have 1 mount point for incomplete. and 1 for each category. Did this through web gui after pkg installed and operational with correct users. have to have correct users to confiugre sab and work.
/usr/local/sabnzbd/Downloads/complete/Movies​
/usr/local/sabnzbd/Downloads/complete/TV​
/usr/local/sabnzbd/Downloads/incomplete​


Make jail through webgui
Start the jail and go to shell from the right three dot selection area.

You have to enter this below and start and stop it otherwise you don't get .ini to edit

pkg install sabnzbdplus​
sysrc sabnzbd_enable="YES"​
service sabnzbd start​
service sabnzbd status​
service sabnzbd stop​
edit /usr/local/sabnzbd/sabnzbd.ini​


Go to line 85 to edit - host = 127.0.0.1 and change it to host = 0.0.0.0

It seems to be working well.
Instead of editing sabnzbd.ini try this method

iocage exec sabnzbd sed -i '' -e 's?host = 127.0.0.1?host = 0.0.0.0?g' /usr/local/sabnzbd/sabnzbd.ini
 
Joined
Sep 21, 2014
Messages
59
Thanks
3
#3
But you should also change the user to have same number that owns your shares on freenas. If you don't you can't post process. I don't think it matters the name, just the number. in my case 816.
Post processing is been driving me crazy from the day iocage jails was introduced.
Can you elaborate more about this number that owns shares on freenas?. Do you mean the user that logs into FreeNAS? an example would be appreciated.
 
Joined
Feb 11, 2016
Messages
27
Thanks
2
#4
Do you have mount points in SAB jail? The source points should be visable under storage> then pools. you can choose the 3 dots on the right and edit permissions. This is to set what group owns everything in storage. Mine is user and group "media" that is 816 in the user and group section. Post processing doesnt work because the default owner of SAB is not the same as who owns the share. You have to change SAB by running that last section of code but replacing 816 with the number of the group that owns theshares.
 
Joined
Sep 21, 2014
Messages
59
Thanks
3
#5
Thanks, I spent several hours trying to educate myself and I think I have managed successful by implementing the idea, waiting to install other jails and starts testing.
 
Joined
Feb 11, 2016
Messages
27
Thanks
2
#6
No worries and good luck. It took me so long to get this running. If you are still are stuck just ask.
 
Joined
Dec 27, 2013
Messages
14
Thanks
2
#7
Thanks for the instructions on this. I put this into a format similar to Pentaflake in that post on FN11.2 iocage jails

Code:
echo '{"pkgs":["sabnzbdplus","ca_root_nss"]}' > /tmp/pkg.json

# remember to replace <IP>/<MASK> e.g(192.168.1.2/24) and <GATEWAY> e.g(192.168.1.1)
iocage create -n "sabnzbd" -p /tmp/pkg.json -r 11.2-RELEASE ip4_addr="vnet0|<IP>/<MASK>" defaultrouter="<GATEWAY>" vnet="on" allow_raw_sockets="1" boot="on"
rm /tmp/pkg.json

# config file for sabnzbd outside is on dataset outside of jail.
zfs create media/apps/sabnzbd
chown -R media:media /mnt/media/apps/sabnzbd

#Its mount point in the jail
iocage exec sabnzbd mkdir /config

# datasets are owned by media and sabnzbd is run by media
iocage exec sabnzbd "pw user add media -c media -u 8675309 -d /nonexistent -s /usr/bin/nologin"
iocage exec sabnzbd chown -R media:media /config

# I use the watchfolder on occasion aready owned by media
iocage exec sabnzbd mkdir /mnt/watchfolder

# Remember the download mount points must match radarr/sonnar mount points
# for example when sab finished it says the show is at /mnt/downloads/complete/tv/YOUR_SHOW
# sonarr then looks for it at /mnt/downloads/complete/tv/YOUR_SHOW in its jail
iocage exec sabnzbd mkdir /mnt/downloads

# Mount em up and get ready to move out
iocage fstab -a sabnzbd /mnt/media/apps/sabnzbd /config nullfs rw 0 0
iocage fstab -a sabnzbd /mnt/media/watchfolder /mnt/watchfolder nullfs rw 0 0
iocage fstab -a sabnzbd /mnt/media/downloads /mnt/downloads nullfs rw 0 0

iocage exec sabnzbd sysrc "sabnzbd_enable=YES"
iocage exec sabnzbd sysrc "sabnzbd_conf_dir=/config"
iocage exec sabnzbd sysrc "sabnzbd_user=media"
iocage exec sabnzbd sysrc "sabnzbd_group=media"

# This creates this initial sabnzbd.ini file. If you already have one just copy it directly to /config
iocage exec sabnzbd service sabnzbd start
iocage exec sabnzbd service sabnzbd stop
iocage exec sabnzbd sed -i '' -e 's?host = 127.0.0.1?host = 0.0.0.0?g' /config/sabnzbd.ini
iocage exec sabnzbd service sabnzbd start


If everything went okay you should be able to access sabnzbd
<JAILIP>:8080
Make sure you configure sabnzbd folders to point to your /mnt/downloads
e.g.
Temporary Download Folder = /mnt/downloads/incomplete
Completed Download Folder =/mnt/downloads/complete
Watched Folder = /mnt/watchfolder

If you have permission trouble try spaming chown -R media:media on your datasets and mount points.
 
Joined
Sep 21, 2014
Messages
59
Thanks
3
#8
Most of the installations of these iocage jails are easy to follow with minor extra changes but as soon as you start creating users and groups with their permissions and if you don't understand how they work together you get lost. Their is a lot of fiddling between chown and chmod to make things work. From my side everything is clear thanks to you guys and others from this forum. Sabnzbd and Medusa running fine without any issues. Preparing to install SickGear and Sickchill for more testing.
 
Top