How to install CouchPotato and SickChill on Raspberry Pi

…or just change the .service files to

Group=osmc

Imagine there are many more programs “depending” on each other.
Would you add each user in the other programs group and vice versa? I think this could get chaotic.
Osmc group has root privileges?! In this case I think it’s a huge security risk to add all these programs to the “root”-osmc group^^ Think of this: Now all programs can acess, read or write all files and folders with group osmc…thats a lot of folders and files isn’t it?

I think that you a little bit overreacted. Why do you think there will be chaos? In some way user nzbget is some sort of root user, if it can read/write/execute or am I wrong? :slightly_smiling: Like I said, if you run with same user, example nzbget for sickrage,couchpotato,nzbget and nzbtomedia, why do you think there will be chaos? What if you have for every service one user, and then of them doesn’t have permissions. I will give one example. Let’s say you use nzbget to sort files on some folder and nzbget don’t give right permissions for sickrage to read/write in that folder. Then you will have some errors. In this case you should give enough permissions to user sickrage or run as user nzbget. Why would be here chaos? And I always give permissions for my users and groups. With command chmod -775 you give all your users to write and read (only not for everybody). So in this case about your concerns, your users have alredy permissions like root, maybe just don’t for execute. So in this way they can read/write and they should if you wan’t them to use for sorting movies and series :slightly_smiling: I understand if you have some personal data of high value and you don’t wan’t any services to reads them. Even look at those folders and files :stuck_out_tongue:

Sure it can but JUST in the folder(s) you allowed it to. Theoretically, with your setup it can read/write/execute all files and folders with group osmc…theoretically. I guess all “important” folders and files have root as group on osmc, i don’t know…but if you gave osmc root privileges hmm…

And how do u do that? I know only one way to run for example sickrage as user nzbget:
Edit .service file of sickrage and change User=sickrage to User=nzbget.
Ok lets say you do that with all programms, now you have one user running serveral different programs. Command top shows you all running processes right? Now I see one user → nzbget running some sort of python instance, etc… I think it could get confusing.[quote=“nenad, post:62, topic:10788”]
With command chmod -775 you give all your users to write and read (only not for everybody). So in this case about your concerns, your users have alredy permissions like root, maybe just don’t for execute. So in this way they can read/write and they should if you wan’t them to use for sorting movies and series
[/quote]
Once again: Yes right, but just in the dedicated folder(s) not outside of them. I say theoretically because I don’t think for example nzbget would mess around with your root fs …but it could :slightly_smiling:
PS: wow, this quickly turned from just my suggestions into an argument :grin:
As stated before, I’m a linux noob, so are you (you said it) but I would love to hear the opinion of an expert here.

Ok, then you should teoretically do this:

  • create new user, take ownership of some folder and files, where you wan’t to give restricted access.
  • add give some restrictions with chown and chmod. More info about permissions: http://linuxcommand.org/lts0070.php

Please tell me, which user you use for owner of personal data? Or for folder where you keep movies? I believe there will be some user like root :slightly_smiling:
Yes, top command do this. If you look this way and you wan’t to have more control, then is better to have more users to check which uses more resources…

Yes it could, but if it happens, then you definitely won’t be the only one, but one of the thousands :smiley: And I don’t believe that they have those intentions :smile:
Everybody has it’s own opinions and suggestions. There is nothing wrong with that. Sometimes it’s nice that someone corrects you or suggest something better. Because then you see if you’ve made mistake or there exist a better way to do it. It would really be nice if some expert on the linux give us his opinions about permissions and users :slightly_smiling:

Yes, I don’t think so either, so I wrote theoretically.
I don’t really have important or personal data on this device, I’m just curious about these things.
And of course like almost always there are more than one right way to accomplish this.
Quintessence: I can’t wait to get the vero2 and try your script :grin:

Thanks for the excellent guide! It worked perfectly until I updated sickrage earlier today.

Now when I try to start the service I get the following error:

Loaded: loaded (/etc/systemd/system/sickrage.service; enabled)
Active: failed (Result: exit-code) since Mon 2016-01-25 23:21:07 CET; 6s ago
Process: 19531 ExecStart=/opt/sickrage/SickBeard.py -q --daemon --nolaunch --datadir=/opt/sickrage (code=exited, status=203/EXEC)

Jan 25 23:21:07 osmc systemd[1]: sickrage.service: control process exited, code=exited status=203
Jan 25 23:21:07 osmc systemd[1]: Failed to start SickRage Daemon.
Jan 25 23:21:07 osmc systemd[1]: Unit sickrage.service entered failed state.

Does anyone have an idea on how to resolve this? It would be greatly appreciated!

If you’re curious and search for an answer, then you learn something, when you get answer. So,there is nothing wrong with that :slightly_smiling: I really hope it will work with no problems :slightly_smiling: I hope you give us a feedback, when you try :smile:

Firstly run command:
Sudo systemctl stop sickrage
Sudo systemctl disable sickrage
After that, go up on the guide for sickrage and begin with:
sudo cp sickrage/runscripts/init.systemd /etc/systemd/system/sickrage.service

Then follow to step 5. I think this should fix your problem.

Received my Vero2 last week. @nenad Remeber our little talk about which permissions to set and what user to run the programs with? I think the time you wrote this post, there was no transmission app in osmc app store. Now there is and I installed transmission first out of app store. Well by default it runs at user osmc so maybe its the better/easier/safer way to just run all these apps like couchpotato, sickrage, nzbget, sabnzb, etc… with one user like osmc.
Like said, I changed the unrar part in your script to apt-get install unrar and for beginning I just installed sickrage. Everything worked, thx for script, saved me some time.
Now I’m asking myself another general question: What is the advised location to install programs to and where to store its configs. Now I already read, it depends on the way of installing a program. If have programs that you extract in one dir and only nedd one directory to run just like sickrage from github one should choose /opt
But on my old setup running the distribution archlinux I had some in /var/lib others in /usr/local/share
What I want to say is, I now have a bit of a “directory/config” mess =D
Now I don’t know where transmission is installed to but I found out that the config file (settings.json) is under /home/osmc/.config/
I also installed nzbget with this guide: Install Latest NZBGet on Ubuntu 15.x with Easy Updates •
Great way, theres a installer on official site which handles everything for you and the guide shows a working .service file =) There’s more in the guide like installing unrar, if you want to add a nzbget and nzbtomedia (it’s a postprocessing script for apps like sickrage, couchpotato or transmission) install script I can quickly write out the steps to install. Let me know! Now nzbget, sickrage and its config files are under /opt
If I need one thing from such programs it’s almost everytime the config files. I hate searching them: “maybe it’s under /var/lib or /opt or /usr/local/share or /home/…”:rage:
I think I’ll put all files into /home/osmc/… and link correctly…Or does someone know if this is “bad practise”?

Happy to read that the scripts were helpfull. About config files, maybe is good idea to have them in one folder like /home/osmc/.config or different folder name. Beacuse, if you have problems with some programs,you have to make backups manually. But if you have them in different folder, you only need to edit startup service for settings path. I believe that couchpotato already have settings in /home/couchpotato/.couchpotato. Sickrage have in location /opt/sickrage. Yes, I see that script while ago, and is nice, beacuse you can choose what to install. My opinion is that configuration and database files is better if there are not in same directory with programs. You never know if you will have some problems with those programs. But you will know that you settings and database files are safe on other location and you can always copy them to other location via samba. Beacuse you already have access to home folder via samba. Believe me, I have around 600 movies, and it takes alot time to scan folders with couchpotato and with copying database and configuration files, you definitely safe time :slight_smile:

This is another nice and easy way to install programs:

Concerning backups I’m not worried at all. I use rsnapshot, which uses rsync command, to create daily, weekly and monthly backups of the whole system.
Sickrage itself and also nzbget have a backup option too. It’s quite nice if you are moving to another system.

Looks good but I can’t figure out where the programs “come from”.
In archlinux for example there’s a sickrage package that is maintained. Or you could get it from github, which is better I think. Also nzbget and nzbtomedia is missing for me :grin:
But do you know if it works under debian? It states ubuntu and derivates…but nowhere states debian.
Since osmc is based on debian it would be nice…

For sickrage I know. hmm… I don’t know for this one from where they comes. But I know that from below are from github and I belive that they work for debian. It was tested on erlier version.
Another easy way for installation:

First time I saw that sickgear, and still don’t know if it’s for torrents too :smiley: and what’s the drifference :slight_smile:

There are lots of different sick… In my understanding sickbeard was first and then there where other believes, etc. and it split up in others like sickrage, sickgear…
I first used sickbeard. In my opinion sickrage is way better and sickbeard is quite outdated in some aspects.

1 Like

Hello!

Sickrage has been failing to start for a couple of months I think now, as I don’t use it much haven’t payed attention to it until now, here is the log I’m getting:

Mar 29 11:15:15 osmc SiCKRAGE.py[21940]: File "/opt/sickrage/sickrage/__init__.py", line 701, in main
Mar 29 11:15:15 osmc SiCKRAGE.py[21940]: install_reqs(optional=INSTALL_OPTIONAL, user=USER)
Mar 29 11:15:15 osmc SiCKRAGE.py[21940]: File "/opt/sickrage/requirements/__init__.py", line 112, in...reqs
Mar 29 11:15:15 osmc SiCKRAGE.py[21940]: install_pip(user)
Mar 29 11:15:15 osmc SiCKRAGE.py[21940]: File "/opt/sickrage/requirements/__init__.py", line 33, in ..._pip
Mar 29 11:15:15 osmc SiCKRAGE.py[21940]: with open(file_name, 'wb') as f:
Mar 29 11:15:15 osmc SiCKRAGE.py[21940]: IOError: [Errno 13] Permission denied: u'get-pip.py'
Mar 29 11:15:15 osmc systemd[1]: sickrage.service: control process exited, code=exited status=1
Mar 29 11:15:15 osmc systemd[1]: Failed to start SickRage Daemon.
Mar 29 11:15:15 osmc systemd[1]: Unit sickrage.service entered failed state.

I followed some steps posted above, about re-doing some of the steps, but no luck. I don’t know why is it giving permission denied, because I have permissions to opt/sickrage. Also, this is the error I’m getting after redoing the steps, before I was getting a python 2.7 error, i think “no such file or directory”.

Any ideas? :slight_smile:
Thanks!!

Hello,

did you create user and group sickrage and add to osmc group to grant permissions?

sudo useradd sickrage
sudo usermod -a -G osmc sickrage

did you use the same user sickrage (with lower case) in file:

sudo nano /etc/systemd/system/sickrage.service

User=sickrage
Group=sickrage

Did you run these two commands?

sudo chmod +x /opt/sickrage
sudo chown -R sickrage:sickrage /opt/sickrage

did you delete?

/usr/bin/python2.7" from /etc/systemd/system/sickrage.service

did you try update and upgrade?

sudo apt-get update
sudo apt-get upgrade

Can you tell me which version of python you have?
Are you using Couchpotato or any program who needs python?

python -V

Thanks for you reply!

I am OK with everything you mentioned. Groups and users ok, etc.

I have Python 2.7.9, I have CouchPotato installed which I use all the time. Also have other web interfaces: tbheadend, cups (just intalled yesterday), Transmission and some Kodi ones.

What can I help with?

1 Like

Can you please go to those folders where are files and type command ls -lh, to check permissions?

Can you please copy here text in file:
sudo nano /etc/systemd/system/sickrage.service

Nenad, thank you very much for the scripts! I used it to successfully install Couchpotato onto my Raspberry Pi 3 when manual installation wouldn’t work. There is one issue I’m trying to resolve, however. Renamer won’t do a thing, even though it’s on. Files downloaded by NZBGet stay in the completed folder and are not renamed or moved. Further up the thread I saw maybe a difference in permissions might be the issue. I’m not familiar enough with Linux to check whether the permissions are in order. Maybe you or other users could check?

/opt/CouchPotatoServer was owned by ‘root’ but I’ve chown’ed it to ‘couchpotato’ with sudo chown -R couchpotato:couchpotato /opt/CouchPotatoServer. This is the output of ls -lh:
osmc@osmc:/opt/CouchPotatoServer$ ls -lh totaal 88K -rw-r--r-- 1 couchpotato couchpotato 1,6K mei 1 13:34 config.rb drwxr-xr-x 5 couchpotato couchpotato 4,0K mei 1 13:34 couchpotato -rwxr-xr-x 1 couchpotato couchpotato 4,6K mei 1 13:34 CouchPotato.py -rw-r--r-- 1 couchpotato couchpotato 5,7K mei 1 13:34 Gruntfile.js drwxr-xr-x 2 couchpotato couchpotato 4,0K mei 1 13:34 init drwxr-xr-x 39 couchpotato couchpotato 4,0K mei 1 13:34 libs -rw-r--r-- 1 couchpotato couchpotato 35K mei 1 13:34 license.txt -rw-r--r-- 1 couchpotato couchpotato 730 mei 1 13:34 package.json -rw-r--r-- 1 couchpotato couchpotato 48 mei 1 13:34 py-dev-requirements.txt -rw-r--r-- 1 couchpotato couchpotato 6,1K mei 1 13:34 README.md -rw-r--r-- 1 couchpotato couchpotato 33 mei 1 13:34 version.py

For the home folder:
osmc@osmc:/home/couchpotato$ ls -lh totaal 0

NZBGet’s folder for completed movie downloads:
osmc@osmc:/mnt/media/NZBGet/completed$ ls -lh totaal 8,0K drwxr-xr-x 11 osmc osmc 4,0K mei 5 13:18 Movies drwxrwxr-x 2 osmc osmc 4,0K mei 5 20:07 Series

The folder where the movies should be moved to:
osmc@osmc:/mnt/media$ ls -lh totaal 40K drwx------ 2 root root 16K apr 26 17:27 lost+found drwxr-xr-x 2 osmc osmc 4,0K apr 29 22:00 Movies drwxr-xr-x 3 osmc osmc 12K mei 2 20:34 Music drwxrwxr-x 7 osmc osmc 4,0K mei 5 20:20 NZBGet drwxr-xr-x 34 osmc osmc 4,0K mei 5 20:01 Series

Do you see anything that’s wrong? If so, how can I solve it? I’d be happy to provide you with other output if necessary Thanks for the help!

Hello, happy to hear that was helpful :slight_smile: I think permissions are ok, but there is one problem with couchpotato, do you use the same completed folder for tv shows and other files? Try to use different completed folder, maybe something like movies. Maybe will that help, because there was a problem with couchpotato and I don’t know if it’s resolved. But movies weren’t renamed if the completed folder was the same for tv shows. Did you try this?

Thanks for the reply! No, I have two separate folders under /mnt/media/NZBGet/completed; one for Series (from which Sonarr successfully picks up completed files and renames and moves them) and one for Movies (from which Couchpotato is supposed to see the files). See also the output:

NZBGet’s completed folder with the subfolder for movie downloads:
osmc@osmc:/mnt/media/NZBGet/completed$ ls -lh totaal 8,0K drwxr-xr-x 11 osmc osmc 4,0K mei 5 13:18 Movies drwxrwxr-x 2 osmc osmc 4,0K mei 5 20:07 Series

in Couchpotato I have /mnt/media/Movies/ as the To folder and /mnt/media/NZBGet/completed/Movies/ as the From folder. When clicking on the latter to change the folder, I can see the individual folders for each downloaded movie, but CP is just not doing anything with it.

Maybe worth mentioning as well is that running the rename command manually (:/api//renamer.scan) gives “{“success”: true}”, but nothing really happens.