diff --git a/Autostart-on-Linux.md b/Autostart-on-Linux.md index 2b6211b..aa931ee 100644 --- a/Autostart-on-Linux.md +++ b/Autostart-on-Linux.md @@ -39,53 +39,46 @@ WantedBy=multi-user.target CPU: 9.331s CGroup: /system.slice/radarr.service └─19978 /usr/bin/mono --debug /usr/lib/radarr/Radarr.exe -nobrowser -data=/var/lib/radarr - -Mar 07 10:23:44 apollo systemd[1]: Started Radarr Service. + Mar 07 10:23:44 apollo systemd[1]: Started Radarr Service. If Radarr does not restart after an update, add the following to your systemd service unit: ExecStop=-/usr/bin/mono /tmp/radarr_update/Radarr.Update.exe "ps aux | grep Radarr | grep -v grep | awk '{ print $2 }'" /tmp/radarr_update /opt/Radarr/Radarr.exe -## Upstart (Ubuntu prior to 16.04) +## Upstart Using Upstart allows for more advanced features, such as start/stop and automatic restart if it crashes. -**Create the Radarr Upstart config file** - - sudo edit /etc/init/radarr.conf +### Radarr Upstart File +The upstart file should be saved as `/etc/init/radarr.conf`. -**Paste in the following code, changing the username (right click if using terminal)** ```bash description "Upstart Script to run Radarr as a service on Ubuntu/Debian based systems, as well as others" -#Set username for the process. Should probably be what you use for logging in -setuid yourusername +#Set user and group for the process +setuid user +setgid group +# Install directory env DIR=/opt/Radarr -#This is the install directory. If you installed using a deb package or the Radarr Repository you do not need to change this -setgid nogroup start on runlevel [2345] stop on runlevel [016] respawn exec mono --debug $DIR/Radarr.exe - ``` -Press Ctrl+X then y to save (assuming you're using nano). - -**Start Radarr** - - sudo start radarr +### Start Radarr + sudo start radarr -### Method 2: LSB style init-script (Debian/Ubuntu) +## LSB init-script (Debian/Ubuntu) -1) `sudoedit /etc/init.d/radarr` +### Init File +The init.d file should be saved as `/etc/init.d/radarr` -2) Paste the following: ```bash #!/bin/bash @@ -114,8 +107,8 @@ Press Ctrl+X then y to save (assuming you're us PIDDIR=/var/run/${NAME} PIDFILE=${PIDDIR}/${NAME}.pid - RUNASUSER=root - RUNASGROUP=root + RUNASUSER=user + RUNASGROUP=group RUNAS=$RUNASUSER:$RUNASGROUP DATADIR=/home/$RUNASUSER/ @@ -183,76 +176,24 @@ Press Ctrl+X then y to save (assuming you're us exit 0 ``` -3) Press Ctrl+X then y to save. -3.5) Set the init.d script as executable `sudo chmod +x /etc/init.d/radarr` +### Make init.d script executable +`sudo chmod +x /etc/init.d/radarr` -4) `sudo insserv -v radarr` +### Run insserv +`sudo insserv -v radarr` Note: May need to run `sudo ln -s /usr/lib/insserv/insserv /sbin/insserv` first if insserv is not found. -5) `sudo /etc/init.d/radarr start` +## Start init.d script +`sudo /etc/init.d/radarr start` Note: The script by default runs as root. I suggest adding an radarr user (`useradd -m -d /var/lib/radarr --gid nogroup radarr`) and adjusting the script so that RUNASUSER=radarr & RUNASGROUP=nogroup. -### Method 3: init.d script (Debian)### - -Please see [here](https://github.com/Radarr/Radarr/wiki/Autostart-on-Debian). - - -### Method 4: RC.Local -**Please Note: This is not the most elegant solution but it works** -*** -**This Method Provided by:** protocol77 - -This Guide is to help those who would like to use linux to run Radarr at time of writing this there is not "Install As Service" option like with the Windows Build so this needs to be done until a better alternative is found i have personally tested it so you should have no issues if you do please post in the Radarr Forums (https://forums.radarr.tv/) and someone will try and help you. - -**First ** -make sure Radarr is installed you can go here to find out how to do that https://github.com/Radarr/Radarr/wiki/Installation - -Next I created a .sh or batch file to automate the process of type "sudo mono /opt/Radarr/Radarr.exe" -Here is a link to the batch file so it saves you all from having to do this even though it was easy if you open in a text editor you will see - -**Batch File:** (Just Hit Download to grab it) -http://goo.gl/4c8yWg - -Next there are two ways of doing this - -**Method One:** - -is using rc.local you do this by opening a terminal windows and typing (without quotes) "sudo nano /etc/rc.local" (or if easier you can use a text editor like gedit, pluma, leafpad whatever you have just replace the nano part with what you want - -Once this is open go to the bottom and just above where it says "exit 0" type the following for eg. - -/bin/sh /home/server/Desktop/Radarr.sh - -mine was saved to my desktop on my linux machine you will need to edit this to wherever you put the Radarr.sh file you downloaded above but remember to keep the /bin/sh first then a space then the rest - -**Method Two:** (With Screenshots) - -Go to your menu and find the application to set startup items this may be called many things mine was called Session And Startup - -http://i.imgur.com/qqw8ghT.png - -Once this is open i went to Application AutoStart there i clicked on the add button - -http://i.imgur.com/FqVFXEQ.png - -Next i added the following which you will notice is the same as the one in Method One "/bin/sh /home/server/Desktop/Radarr.sh" - -http://i.imgur.com/8gokS5j.png - -after that i gave it a name and then pressed "Ok" and then "Close" i then did a reboot of the system - -on reboot i did notice it took a couple more seconds to login this is because this is setting that command to run at login but once logged in i opened my browser and went to http://localhost:8989 and voila it started - - -I cannot guarantee this will work but it seems to be working for me i am Linux newbie and this took me a while to figure out so hopefully by posting here it will help someone else avoid the trouble i went through - -### FreeBSD/FreeNAS ### +## FreeBSD/FreeNAS https://raw.github.com/tofagerl/freedrone/master/nzbdrone -### Supervisor ### +## Supervisor ``` [program:Radarr]