Okay I managed to get NZB Hydra working by taking the headphones script and making some changes, also taking the rc file from this repo:
https://github.com/josh4trunks/freebsd-ports/blob/master/news/nzbhydra/files/nzbhydra.in
echo '{"pkgs":["databases/py-sqlite3","security/py-openssl","ca_root_nss","git"]}' > /tmp/pkg.json
iocage create -n "nzbhydra" -p /tmp/pkg.json -r 11.1-RELEASE ip4_addr="vnet0|<IP>/<MASK>" defaultrouter="<GATEWAY>" vnet="on" allow_raw_sockets="1" boot="on"
rm /tmp/pkg.json
iocage fstab -a nzbhydra /mnt/JRaid/Applications/Nzbhydra /config nullfs rw 0 0
iocage exec nzbhydra ln -s /usr/local/bin/python2.7 /usr/local/bin/python
iocage exec nzbhydra git clone
https://github.com/theotherp/nzbhydra.git /usr/local/share/nzbhydra
iocage exec nzbhydra "pw user add nzbhydra -c nzbhydra -u 1001 -d /nonexistent -s /usr/bin/nologin"
iocage exec nzbhydra chown -R nzbhydra:nzbhydra /config /usr/local/share/nzbhydra
iocage exec nzbhydra ee /usr/local/etc/rc.d/nzbhydra
#!/bin/sh
#
# PROVIDE: nzbhydra
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# nzbhydra_enable (bool): Set to NO by default.
# Set it to YES to enable it.
# nzbhydra_user: The user account nzbhydra daemon runs as what
# you want it to be. It uses 'nzbhydra' user by
# default. Do not sets it as empty or it will run
# as root.
# nzbhydra_group: The group account nzbhydra daemon runs as what
# you want it to be. It uses 'nzbhydra' group by
# default. Do not sets it as empty or it will run
# as wheel.
# nzbhydra_data_dir: Directory where nzbhydra configuration
# data is stored.
# Default: /var/db/nzbhydra
. /etc/rc.subr
name="nzbhydra"
rcvar="${name}_enable"
load_rc_config ${name}
: ${nzbhydra_enable:="NO"}
: ${nzbhydra_user:="nzbhydra"}
: ${nzbhydra_group:="nzbhydra"}
: ${nzbhydra_data_dir:="/config"}
pidfile="/var/run/nzbhydra/nzbhydra.pid"
command="/usr/local/bin/python"
command_args="/usr/local/share/nzbhydra/nzbhydra.py --config ${nzbhydra_data_dir}/settings.cfg --database ${nzbhydra_data_dir}/nzbhydra.db --pidfile ${pidfile} --daemon --nobrowser"
start_precmd="nzbhydra_prestart"
nzbhydra_prestart() {
if [ ! -d ${pidfile%/*} ]; then
install -d -o ${nzbhydra_user} -g ${nzbhydra_group} ${pidfile%/*}
fi
if [ ! -d ${nzbhydra_data_dir} ]; then
install -d -o ${nzbhydra_user} -g ${nzbhydra_group} ${nzbhydra_data_dir}
fi
}
run_rc_command "$1"
iocage exec nzbhydra chmod u+x /usr/local/etc/rc.d/nzbhydra
iocage exec nzbhydra sysrc "nzbhydra_enable=YES"
iocage exec nzbhydra sysrc "nzbhydra_user=nzbhydra"
iocage exec nzbhydra sysrc "nzbhydra_data_dir=/config"
iocage exec nzbhydra service nzbhydra start
Obviously change your user ID and freenas mount paths. Please add this to the resource