mirror of
https://github.com/Lidarr/Lidarr.git
synced 2024-11-04 12:40:10 -08:00
Page:
Installation (FreeBSD FreeNAS)
Pages
API
Album Lookup
Album
AppData Directory
Artist Lookup
Artist
Autostart on Linux
Calendar
Command
Connections
Custom Post Processing Scripts
Disable Authentication
Diskspace
Docker
FAQ
Forgot my Password
Health Checks
History
Home
Images
Indexer Seed Ratio
Installation (FreeBSD FreeNAS)
Installation
Issue Labeling Scheme
Log Files
Metadata Source
Naming
Parse
Profile
Profiles
Queue
Release Branches
Release Push
Release
Rootfolder
Setup Development Environment
Supported DownloadClients
Supported ImportLists
Supported Indexers
Supported Notifications
System Backup
System Status
Tags
Track
TrackFile
Wanted Cutoff
Wanted Missing
Write Tags
0
Installation (FreeBSD FreeNAS)
Qstick edited this page 2019-09-08 14:38:57 -04:00
contribution by samslice841635
I installed Lidarr in a FreeNAS jail. My installation is specifically on a FreeNAS 11.1 rig. FreeNAS is built on top of FreeBSD, and although these are the steps I used to install Lidarr in a FreeNAS jail, this guide should work for any FreeBSD-based scenario. This guide assumes this installation is being performed on another machine via an SSH terminal (PuTTY) from another computer.
Prep Work
- Create a user for your Lidarr daemon to run as
pw useradd lidarr -d /nonexistent
- Intall necessary bits. If you're installing this on a system/jail that is already running Sonarr and/or Radarr, mono and sqlite3 should already be installed.
pkg install wget nano mono sqlite3
cd
into the directory you wish to drop Lidarr into. This is 100% personal preference.
cd /usr/local/share
Download and Setup
- Back your desktop, launch your internet browser of choice and go to https://github.com/lidarr/Lidarr/releases
- Right-click on the Lidar.develop.x.x.x.xxx.linux.tar.gz file and select "Copy link location" (verbiage may vary from browser to browser)
- Back in your SSH window, (assuming you're still in the directory you wish to install Lidarr into) type
wget
and paste the link you copied from your internet browser
wget https://github.com/lidarr/Lidarr/releases/download/vX.X.X.XXXX/Lidarr.develop.X.X.X.XXXX.linux.tar.gz
- Once downloaded, the g-zipped tarball needs to be extracted
tar -xvf Lidarr.develop.0.x.x.x.xxx.linux.tar.gz
- Verify the tarball extracted properly into the Lidarr directory
ls -l Lidarr/
- Delete the tarball
rm Lidarr.develop.*.linux.tar.gz
Setting Up The Daemon
- CD into your rc.d directory (YMMV)
cd /usr/local/etc/rc.d
- Now we need to create an rc.d script to run Lidarr as a daemon
nano lidarr
- Go to the section at the end of this guide labeled "Daemon Script". You'll need to copy and paste my example into your new lidarr file, adjusting any paths you need to adjust.
- Once you've got your lidarr file created and filled out, we need to make sure the ownership and permissions are correct and verify
chmod +x lidarr && ls -Fl lidarr
- Output should look like the below (note the permissions and the * at the end of the file name)
-rwxr-xr-x 1 root wheel 756 Jan 11 19:42 lidarr*
- Now, add your new rc.d script to the startup
echo 'lidarr_enable="YES"' >> /etc/rc.conf
- Start the service
service lidarr start
- Navigate to your new Lidarr service in your browser and enjoy!
http://ip_addr:8686
Daemon Script
Pay attention to lines 23, 27, and 30 (look for the comment lines immediately above). These lines have directories and executable locations that may need to be adjusted based on your own system's setup. This is the file that works on my individual installation. YMMV
#!/bin/sh
#
# Author: Jarod Sams
#
# PROVIDE: lidarr
# REQUIRE: LOGIN
# KEYWORD: shutdown
# Add the following lines to /etc/rc.conf to enable lidarr:
# lidarr_enable="YES"
. /etc/rc.subr
name="lidarr"
rcvar=lidarr_enable
load_rc_config $name
: ${lidarr_enable="NO"}
: ${lidarr_user:="lidarr"}
# This next directory can be changed to whatever you want
: ${lidarr__data_dir:="/usr/local/lidarr"}
pidfile="${lidarr__data_dir}/lidarr.pid"
# You may need to adjust the mono location if your mono executable is somewhere else
procname="/usr/local/bin/mono"
command="/usr/sbin/daemon"
# The directory laid out in the next line will need to be changed if your Lidarr directory is elsewhere
command_args="-f ${procname} /usr/local/share/Lidarr/Lidarr.exe --nobrowser --data=${lidarr__data_dir}"
start_precmd=lidarr_precmd
lidarr_precmd()
{
export XDG_CONFIG_HOME=${lidarr__data_dir}
if [ ! -d ${lidarr__data_dir} ]; then
install -d -o ${lidarr_user} ${lidarr__data_dir}
fi
}
run_rc_command "$1"