Updated guide is published here.
Since the introduction of FreeNAS 11.2, there are many under-the-hood changes that makes a hassle migrating from previous version. One of the major changes is the replacement of warden jail with iocage jail.
The removal of well-known NZB downloader SABnzbd from the standard Plugin leaves many users having to manually install it in the new iocage jail.
This is the a run down of how I got everything to work including the elusive permissions.
Prerequisite:
– A dataset created for the downloads (“Shared” in my example)
– “Shared” is own by default FreeNAS user “media” and group “media” (PID/GID 8675309)
– Downloads goes to /mnt/NASX/Shared/z-complete
– Temporary files goes to /mnt/NASX/Shared/z-incomplete
– SSH is enabled on FreeNAS
Enter the following commands:
echo '{"pkgs":["nzbget","ca_root_nss"]}' > /tmp/pkg.json
iocage create -n "sabnzbd" -p /tmp/pkg.json -r 11.2-RELEASE ip4_addr="vnet0|192.168.86.232/24" defaultrouter="192.168.86.1" vnet="on" allow_raw_sockets="1" boot="on"
# Creates a jail called “sabnzbd” on 192.168.86.232 and the default gateway is 192.168.86.1rm /tmp/pkg.json
iocage exec sabnzbd mkdir -p /downloads
# Adds the folder “downloads” in the jailiocage exec sabnzbd mkdir -p /incomplete
# Adds the folder “incomplete” in the jailiocage fstab -a sabnzbd /mnt/NASX/Shared/z-complete /downloads nullfs rw 0 0
# Adds a mount point in pool /mnt/NASX/Shared/z-complete to /downloads in jailiocage fstab -a sabnzbd /mnt/NASX/Shared/z-incomplete /incomplete nullfs rw 0 0
# Adds a mount point in pool /mnt/NASX/Shared/z-incomplete to /incomplete in jailiocage exec sabnzbd ln -s /usr/local/bin/python2.7 /usr/bin/python
iocage exec sabnzbd ln -s /usr/local/bin/python2.7 /usr/bin/python2
iocage exec sabnzbd "pw groupadd -n media -g 8675309"
iocage exec sabnzbd "pw user add media -c media -u 8675309 -d /nonexistent -s /usr/bin/nologin"
iocage exec sabnzbd chown -R media:media /downloads /incomplete
iocage exec sabnzbd sysrc 'sabnzbd_user=media'
iocage exec sabnzbd chown -R media:media /var/run/sabnzbd
# 8 – 14 set SABnzbd to run as “media” and enable it read/write permission to the mount pointsiocage exec sabnzbd sysrc sabnzbd_enable=YES
iocage exec sabnzbd edit /usr/local/sabnzbd/sabnzbd.ini
# scrolls to line 85, edit the host to 0.0.0.0 and allow you can access from the 192.168.86.232. Press Esc and “a” to save the ini.iocage exec sabnzbd service sabnzbd start
# Restart the service, access from 192.168.86.232:8080
There should not be any errors running any of the above commands, if there is, check syntax or let me know if there is a problem.
Once I logged in, changed the config -> Folders to /downloads and /incomplete respectively and hit Save Changes.
Enjoy!