Skip to content

Installation on FreeBSD

Wannes Van de Putte edited this page Apr 13, 2020 · 7 revisions

Disclaimer: I copied most of this tutorial from Bazarr. So all credits for this guide go to the creator/developer of Bazarr.

Apparently this script is pretty scrappy. It does let Addarr start for me and that's all it should do at the end ;)

Installing Addarr on FreeBSD

  • Install the required software pkg update && pkg install git python3X py3X-pip. Where the X is replaced with the Python3 version you use to run Addarr
  • You can check if Python and Pip are installed correctly with these commands: python --version pip --version
  • cd /usr/local/share
  • Clone the repository using git clone https://github.com/Waterboy1602/Addarr.git (this will download the files to /usr/local/share/Addarr)
  • cd Addarr
  • Rename config_example.yaml to config.yaml and edit the file to your configuration
  • Install Python requirements using pip install -r requirements.txt --upgrade
  • Check if it works with python3 addarr.py. You should see Start chatting with Addarr in Telegram

Starting on boot

  • A user need to be created for Addarr to run as a daemon, the script is written for a user called addarr but this can be changed by modifying addarr_user="addarr" in /etc/rc.conf. In FreeBSD you can create a user by the command adduser.
  • Change permission on Addarr directory by running the following command: chown -R addarr_user /usr/local/share/Addarr where addarr_user is the user you've created.
  • nano /usr/local/etc/rc.d/addarr
  • Enter this:
#!/bin/sh
# PROVIDE: addarr
# REQUIRE: LOGIN
# KEYWORD: shutdown

# Add the following lines to /etc/rc.conf to enable addarr:
# addarr_enable="YES"
# Optionally add:
# Note: The addarr_user must be unique as the stop_postcmd kills the other running process
# addarr_user="addarr"

. /etc/rc.subr

name="addarr"
rcvar=addarr_enable

load_rc_config $name

: ${addarr_enable="NO"}
: ${addarr_user:="addarr"}
: ${addarr_data_dir:="/usr/local/Addarr"}

pidfile="/usr/local/Addarr/addarr.pid"
procname="/usr/local/bin/python3"
command="/usr/sbin/daemon"
command_args="-f -p ${pidfile} ${procname} /usr/local/share/Addarr/addarr.py"

start_precmd=addarr_precmd
stop_postcmd=addarr_postcmd

addarr_precmd()
{
	export XDG_CONFIG_HOME=${addarr_data_dir}
        export GIT_PYTHON_REFRESH=quiet

	if [ ! -d ${addarr_data_dir} ]; then
		install -d -o ${addarr_user} ${addarr_data_dir}
	fi
}

addarr_postcmd()
{
	killall -u ${addarr_user}
}

run_rc_command "$1"

  • Save and exit (ctrl+x -> y -> enter)
  • Make the file executable chmod +x /usr/local/etc/rc.d/addarr
  • nano /etc/rc.conf
  • On the last line add addarr_enable="YES"
  • Reboot