[synology] user permissions & renamer issues

Most commonly asked questions will have thire awnsers here, please search before asking!
User avatar
clinton.hall
Moderator
Posts: 9224
Joined: 28 Jun 2012 12:55
Has thanked: 94 times
Been thanked: 465 times
Contact:
Status: Offline

[synology] user permissions & renamer issues

Postby clinton.hall » 09 Feb 2013 06:15

Hi all, here is a procedure to resolve file permission issues that break the renamer on Synology.

Thanks to @stefve and @chestyspankers

1. created user "apps" through control panel

2. added "apps" user to group "users" (edited /etc/group)

Code: Select all

users:x:100:couchpotatoserver,sabnzbd,headphones,sickbeard,apps


3. gave /bin/sh to user "apps" (edited /etc/passwd)

Code: Select all

apps:x:1029:100::/var/services/homes/apps:/bin/sh


4. change ownership of currently installed packages

Code: Select all

cd /volume1/@appstore
chown -R apps:users couchpotatoserver headphones sabnzbd sickbeard


5. change ownership of work in progress and current media

Code: Select all

cd /volume1
chown -R apps:users downloads/* media/*



6. change USER="couchpotatoserver" to USER="apps"

Code: Select all

vi /var/packages/couchpotatoserver/scripts/start-stop-status


7. change USER="headphones" to USER="apps"

Code: Select all

vi /var/packages/headphones/scripts/start-stop-status


8. change USER="sabnzbd" to USER="apps"

Code: Select all

vi /var/packages/sabnzbd/scripts/start-stop-status


9. change USER="sickbeard" to USER="apps"

Code: Select all

vi /var/packages/sickbeard/scripts/start-stop-status


10. restart

11. Open package manager and click "run" on each of the services

12. Restart again to double check that services auto start.

Services come up automatically again and are available.

codered
Junior Member
Posts: 12
Joined: 29 Mar 2013 18:20
Contact:
Status: Offline

RE: [synology] user permissions & renamer issues

Postby codered » 30 Mar 2013 18:49

This is great, worked perfectly. Thanks.

dmdelorme
Junior Member
Posts: 1
Joined: 08 Apr 2013 03:24
Contact:
Status: Offline

RE: [synology] user permissions & renamer issues

Postby dmdelorme » 08 Apr 2013 04:01

I have a similar problem with Ubuntu server 12.10 when I have made all the changes with the exception that they run as my user but still have the problem. when CP creates a dir to move and rename the movie it creates a Dir with weird permissions.
this is what gets created a dir with 41411 permissions owned by user:user dr----x--t
and the complete Dir gets a ignore file

04-07 19:53:28 DEBUG [e.providers.metadata.base] Creating nfo file: /media/raid/Media/Movies/XXXXX 2004/XXXXX1080p.nfo

04-07 19:53:28 ERROR [hpotato.core.plugins.base] Unable writing to file "/media/raid/Media/Movies/XXXXX 2004/XXXXX1080p.nfo":
[Errno 13] Permission denied: '/media/raid/Media/Movies/XXXXX 2004/XXXXX1080p.nfo'

04-07 19:53:28 DEBUG [e.providers.metadata.base] Failed setting permissions for /media/raid/Media/Movies/XXXXX 2004/XXXXX1080p.nfo: Traceback (most recent call last): File "/home/david/.couchpotato/couchpotato/core/providers/metadata/base.py", line 56, in create os.chmod(name, Env.getPermission('file')) OSError:[Errno 13] Permission denied: '/media/raid/Media/Movies/XXXXX 2004/XXXXX1080p.nfo'

jumarc
Junior Member
Posts: 2
Joined: 19 Apr 2013 00:32
Contact:
Status: Offline

RE: [synology] user permissions & renamer issues

Postby jumarc » 19 Apr 2013 00:39

Hi guys,

Pretty new to using linux commands, and having a bit of trouble with this one. Hoping someone can point me in the right direction?

After making the Apps group, I'm logging into my Synology via SSH on the admin account.

Using vi to edit /etc/groups i get ' "/etc/group" File is read only'.

Trying to use :w! to force i get ' "/etc/group" Permission denied'.

So at this stage I realise that I probably need to run with root permissions to edit, but trying to run 'sudo vi /etc/group' gives me '-sh: sudo: not found'

Any tips on getting write access to these files?

Cheers in advance.

jumarc
Junior Member
Posts: 2
Joined: 19 Apr 2013 00:32
Contact:
Status: Offline

RE: [synology] user permissions & renamer issues

Postby jumarc » 19 Apr 2013 13:48

Ok, chalk up one stupid question to me.

A bit more googling and I worked out you can log in to ssh as user 'root' using the same admin password. The rest of the instructions worked a treat for me, thanks heaps.

jiquem
Junior Member
Posts: 7
Joined: 23 Jul 2013 00:24
Status: Offline

Re: [synology] user permissions & renamer issues

Postby jiquem » 25 Jul 2013 08:20

Hello,

I suggest to create homedir for apps user

Code: Select all

mkdir -p /var/services/homes/apps
chown apps:users /var/services/homes/apps

Frankster
Junior Member
Posts: 1
Joined: 19 Oct 2013 12:01
Status: Offline

Re: [synology] user permissions & renamer issues

Postby Frankster » 19 Oct 2013 12:11

I tried this solution, but it did not work. Moreover it ruined my ssh access to my Synology (same symptoms as described here: http://forum.synology.com/enu/viewtopic ... 45&t=72170)

Who knows how to undo this? I already tried re-editing /etc/passwd but that did not provide the correct solution...

EDIT: fixed SSH access by chown -R /var/empty

nos
Junior Member
Posts: 1
Joined: 24 Dec 2013 13:47
Status: Offline

Re: [synology] user permissions & renamer issues

Postby nos » 24 Dec 2013 13:52

thanks ...

wasykes
Junior Member
Posts: 5
Joined: 04 Jan 2014 01:02
Status: Offline

Re: [synology] user permissions & renamer issues

Postby wasykes » 04 Jan 2014 01:05

Well that's just bullsed up my whole setup now, changing nzbget and sickbeard users to "apps" has caused them to stop working and they won't even start up

EDIT: My bad, I hadn't changed the users for nzbget and sickbeard to apps. All is working now, cheers!!
Really I'm not a fiend, I just watch a lot of tv!!

Image

Image

marcoevich
Junior Member
Posts: 4
Joined: 14 Jan 2014 00:18
Status: Offline

Re: [synology] user permissions & renamer issues

Postby marcoevich » 14 Jan 2014 00:27

Hi Clinton.hall,

First of all thank you for this guide! I was looking for something like this before i have to knock on Ruud's door again :)

I can walk trough all steps with no problem, but on my DS214Play with latest DSM update, the user 'apps' which I created does not stick after a reboot. That results in all apps failing to start.

I created the user in DSM user manager. Do you have any idea why that would fail? I've asked Synology support and they simply tell me they do not support apps like Couchpotato and I have to reset my DSM settings...

Thx in advance!

User avatar
clinton.hall
Moderator
Posts: 9224
Joined: 28 Jun 2012 12:55
Has thanked: 94 times
Been thanked: 465 times
Contact:
Status: Offline

Re: [synology] user permissions & renamer issues

Postby clinton.hall » 14 Jan 2014 04:55

unfortunately, i do not have Synology devicees and therfore can't test.

I don't know why the users would be reset... perhaps someone here with Synology may be able to contribute. Otherwise, try synocommunity (not the actual mods, but the users will hopefully be able to help)

marcoevich
Junior Member
Posts: 4
Joined: 14 Jan 2014 00:18
Status: Offline

Re: [synology] user permissions & renamer issues

Postby marcoevich » 14 Jan 2014 10:35

Thx Clinton, I'll try to find my luck there :)

Regards,
Marcoevich

thomas.haratyk
Junior Member
Posts: 1
Joined: 14 Jan 2014 10:41
Status: Offline

Re: [synology] user permissions & renamer issues

Postby thomas.haratyk » 14 Jan 2014 10:50

Marcoevich,

If the user apps doesn't have access to the shell, the user line in /etc/passwd should look like this :

Code: Select all

apps:x:1029:100::/var/services/homes/apps:/sbin/nologin


Did you properly removed /sbin/nologin and replaced it with /bin/sh ? (like clinton.hall probably did) :

3. gave /bin/sh to user "apps" (edited /etc/passwd)

Code: Select all

apps:x:1029:100::/var/services/homes/apps:/bin/sh


I found out that, if you just add it at the end (i.e. /sbin/nologin:/bin/sh), the GUI make it disappear (because it would be inconsistent I guess) :D

marcoevich
Junior Member
Posts: 4
Joined: 14 Jan 2014 00:18
Status: Offline

Re: [synology] user permissions & renamer issues

Postby marcoevich » 14 Jan 2014 10:57

Hi Thomas,

Thx for the message. I'm not sure what I did... I think I added /bin/sh to it after the /sbin/nologin...

I can't connect to the NAS from work, but I'll sure check it out when I'm home. Thx for the tip!

marcoevich
Junior Member
Posts: 4
Joined: 14 Jan 2014 00:18
Status: Offline

Re: [synology] user permissions & renamer issues

Postby marcoevich » 14 Jan 2014 21:22

Edit: now it works, the user still exists after reboot :D Thx thomas!

I see there are also files like 'group-' and 'passwd-' with an extra '-' appended to it. What is the use of those files??

Also the shortcuts in DSM try to open the apps at their default ports, while for example couchpotato config file shows a different port. Why would the shortcuts do that?

Frederic P
Junior Member
Posts: 7
Joined: 09 Mar 2014 19:42
Status: Offline

Re: [synology] user permissions & renamer issues

Postby Frederic P » 25 Mar 2014 22:02

clinton.hall wrote:2. added "apps" user to group "users" (edited /etc/group)

Code: Select all

users:x:100:couchpotatoserver,sabnzbd,headphones,sickbeard,apps



Hi again,
still struggling getting this to work
just getting this error message

Image

(actually using the CouchPotato Server Custom package from SynoCommunity to use use your repository)
CouchPotato Server Custom
20130901-2
CouchPotato Server Custom allows you to run the fork of your choice of CouchPotato Server. You will be asked for the fork''s git URL during install.

User avatar
clinton.hall
Moderator
Posts: 9224
Joined: 28 Jun 2012 12:55
Has thanked: 94 times
Been thanked: 465 times
Contact:
Status: Offline

Re: [synology] user permissions & renamer issues

Postby clinton.hall » 25 Mar 2014 22:32

That isn't a command that you can run... You need to edit the file /etc/group and add apps to it so that it looks like the line you posted above...

chansey
Junior Member
Posts: 3
Joined: 31 Mar 2014 12:03
Has thanked: 1 time
Status: Offline

Re: [synology] user permissions & renamer issues

Postby chansey » 31 Mar 2014 12:05

Is this the current best practice on how to setup cp on a sinology nas? there is no simpler way?

User avatar
clinton.hall
Moderator
Posts: 9224
Joined: 28 Jun 2012 12:55
Has thanked: 94 times
Been thanked: 465 times
Contact:
Status: Offline

Re: [synology] user permissions & renamer issues

Postby clinton.hall » 31 Mar 2014 13:04

Not that I am aware of.... But I myself don't have a Synology.

michaelnuk
Junior Member
Posts: 7
Joined: 11 Apr 2014 15:48
Has thanked: 1 time
Status: Offline

Re: [synology] user permissions & renamer issues

Postby michaelnuk » 11 Apr 2014 18:15

Managed to do all steps successfully but this one,
cd /volume1
chown -R apps:users downloads/* media/*
When I try it I get

Code: Select all

NAS> chown -R apps:users downloads/* media/*
chown: downloads/*: No such file or directory
chown: media/*: No such file or directory


My Volume1 index is

Code: Select all

NAS> ls -l
drwxrwxrwx   15 root     root          4096 Apr  8 17:38 @appstore
drwx------    2 root     root          4096 Mar 10 16:16 @autoupdate
drwxr-xr-x    5 root     root          4096 Mar 10 16:44 @cloudsync
drwxr-xr-x    4 admin    users         4096 Mar 10 16:22 @database
drwxr-xr-x    5 admin    users         4096 Apr 11 14:31 @download
drwxr-xr-x    2 root     root          4096 Nov 25 19:51 @quarantine
drwxrwxrwx    4 root     root          4096 Apr 11 13:51 @spool
drwxrwxrwx    5 root     root          4096 Apr 11 16:26 @tmp
-rw-------    1 root     root     1562001408 Mar 28 22:14 @transmissiond.core
drwxrwxrwx    4 root     root          4096 Apr 11 14:36 Downloads
drwxrwxrwx    2 root     root          4096 Mar 10 19:21 Freeview Box
drwxrwxrwx    7 root     root          4096 Mar  2 20:55 Storage
-rw-------    1 root     root          7168 Apr 11 13:48 aquota.group
-rw-------    1 root     root          9216 Apr 11 13:48 aquota.user
drwx--x--x    8 root     root          4096 Apr 11 13:34 homes
drwx------    2 root     root         16384 Nov 18 18:19 lost+found
drwxrwxrwx  359 root     root         36864 Mar 31 21:35 music
drwxrwxrwx   31 root     root         16384 Mar 15 19:40 photo
drwxrwxrwx    5 root     root          4096 Mar 12 19:45 surveillance
drwxrwxrwx    4 root     root          4096 Feb 10 16:54 video


Not sure if this step is relevant because I dont have any work in progress but I do have current media.

Thanks


Return to “FAQ”