This is an updated guide to install SABnzbd and possibly other plugins like NZBGet in TrueNAS while maintaining the correct user permissions.
Prerequisite:
– A dataset created for the downloads (“Shared” in my example)
– “Shared” is own by the built-in user “media” and group “media” (PID/GID 8675309)
– Downloads goes to /mnt/Storage-Pool/Shared/z-complete
– Temporary files goes to /mnt/Storage-Pool/Shared/z-incomplete
– SSH is enabled on FreeNAS
Enter the following commands to build the SABnzbd from terminal:
echo '{"pkgs":["sabnzbdplus","ca_root_nss"]}' > /tmp/pkg.json
iocage create -n "sabnzbd" -p /tmp/pkg.json -r 13.1-RELEASE ip4_addr="vnet0|192.168.123.10/24" defaultrouter="192.168.123.1" vnet="on" allow_raw_sockets="1" boot="on"
# Creates a jail called “sabnzbd” on 192.168.123.10 and the default gateway is 192.168.123.1rm /tmp/pkg.json
iocage exec sabnzbd mkdir -p /mnt/downloads
# Adds the folder “downloads” in the jailiocage exec sabnzbd mkdir -p /mnt/incompletes
# Adds the folder “incompletes” in the jailiocage fstab -a sabnzbd /mnt/Storage-Pool/Shared/z-complete /mnt/downloads nullfs rw 0 0
# Adds a mount point in pool /mnt/Storage-Pool/Shared/z-complete to /downloads in jailiocage fstab -a sabnzbd /mnt/Storage-Pool/Shared/z-incomplete /mnt/incompletes nullfs rw 0 0
# Adds a mount point in pool /mnt/Storage-Pool/Shared/z-incomplete to /incomplete in jailiocage 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 /mnt/downloads /mnt/incompletes
iocage exec sabnzbd sysrc "sabnzbd_user=media"
iocage exec sabnzbd sysrc "sabnzbd_group=media"
# Step 8 to 12 apply respective permissions and start sabnzbd service as “media”iocage exec sabnzbd sysrc sabnzbd_enable=YES
iocage exec sabnzbd service sabnzbd start
iocage exec sabnzbd service sabnzbd stop
iocage exec sabnzbd chown -R media:media /var/run/sabnzbd
iocage exec sabnzbd sed -i '' -e 's?host = 127.0.0.1?host = 0.0.0.0?g' /usr/local/sabnzbd/sabnzbd.ini
iocage restart sabnzbd
This is how I built my SABnzbd and I recommend reapplying the permissions to the dataset to ensure the permissions within the jails mount-points and dataset to be consistent.
Once I open up SABnzbd interface, changed the config -> Folders to /mnt/downloads and /mnt/incompletes respectively and hit Save Changes.
Enjoy!