Users dont remain in a group

hi all

i have been busy with users and groups and i have made a group and added users to that group. but when i restart the users go back to the default group that i moved them from even though in that session i even deleted the previous group. so when i started my pc the group was back. odd though in terminal if i go “groups username” the username is shown to be in the correct group, but if i browse to the folder that iam trying to change the group it is showing as the old group and not the one that i created and not the one that is showing in terminal.

i have been using users and groups and changing ownership and changing permissions during reading all this and for the commands i have been using.

something else i noticed when restarting and starting up the system is got messages about watchdog now … i dont recall anything about me doing anything about watchdog

hope this makes sense

I am not really sure what you mean here.

Adding or removing a user from a group doesn’t change the default permissions when files are created. It only impacts what they can access.

Can you describe what you are trying to accomplish?

Those can be ignored. Or if you do a quick search, you can find instructions on how to suppress them. It is a question that gets asked quite a bit.

thanks for the reply

ok well i have 3 users that are all in the same group, i think i have done it right but iam not so sure.

this is what my terminal looks like at the moment

[angelus@Angelus ~]$ sudo chown -R sonarr:media /usr/lib/sonarr
[sudo] password for angelus:
[angelus@Angelus ~]$ sudo chown -R sonarr:media /var/lib/sonarr
[angelus@Angelus ~]$ sudo chown -R sabnzbd:media /usr/lib/sabnzbd
[angelus@Angelus ~]$ sudo chown -R sabnzbd:media /var/lib/sabnzbd
[angelus@Angelus ~]$ sudo chmod g=rwx /var/lib/sabnzbd
[sudo] password for angelus:
[angelus@Angelus ~]$ sudo chmod g=rwx /var/lib/sonarr
[angelus@Angelus ~]$ sudo chmod g=rwx /usr/lib/sonarr
[angelus@Angelus ~]$ sudo chmod g=rwx /usr/lib/sabnzbd
[angelus@Angelus ~]$ ls -l /var/lib/sonarr
total 263192
drwxr-xr-x 3 sonarr media 4096 Apr 20 12:39 ‘90 Day Fiancé’
drwxr-xr-x 3 sonarr sonarr 4096 Apr 25 15:06 Backups
-rw-r–r-- 1 sonarr media 418 Apr 25 10:43 config.xml
drwxr-xr-x 4 sonarr media 4096 Apr 19 08:41 ‘Godfather of Harlem’
drwxr-xr-x 2 sonarr media 4096 Apr 25 15:02 logs
-rw-r–r-- 1 sonarr media 133320704 Apr 25 15:30 logs.db
-rw-r–r-- 1 sonarr media 262144 Apr 25 15:31 logs.db-shm
-rw-r–r-- 1 sonarr media 134126632 Apr 25 15:31 logs.db-wal
drwxr-xr-x 6 sonarr media 4096 Apr 24 02:46 MediaCover
-rw-r–r-- 1 sonarr media 1519616 Apr 25 15:26 sonarr.db
-rw-r–r-- 1 sonarr sonarr 32768 Apr 25 15:31 sonarr.db-shm
-rw-r–r-- 1 sonarr sonarr 197792 Apr 25 15:31 sonarr.db-wal
-rw-r–r-- 1 sonarr media 3 Apr 25 10:43 sonarr.pid
[angelus@Angelus ~]$ ls -l /var/lib/sonarr
total 263228
drwxr-xr-x 3 sonarr media 4096 Apr 20 12:39 ‘90 Day Fiancé’
drwxr-xr-x 3 sonarr sonarr 4096 Apr 25 15:06 Backups
-rw-r–r-- 1 sonarr media 418 Apr 25 10:43 config.xml
drwxr-xr-x 4 sonarr media 4096 Apr 19 08:41 ‘Godfather of Harlem’
drwxr-xr-x 2 sonarr media 4096 Apr 25 15:02 logs
-rw-r–r-- 1 sonarr media 133320704 Apr 25 15:30 logs.db
-rw-r–r-- 1 sonarr media 262144 Apr 25 15:32 logs.db-shm
-rw-r–r-- 1 sonarr media 134126632 Apr 25 15:32 logs.db-wal
drwxr-xr-x 6 sonarr media 4096 Apr 24 02:46 MediaCover
-rw-r–r-- 1 sonarr media 1519616 Apr 25 15:26 sonarr.db
-rw-r–r-- 1 sonarr sonarr 32768 Apr 25 15:32 sonarr.db-shm
-rw-r–r-- 1 sonarr sonarr 234872 Apr 25 15:32 sonarr.db-wal
-rw-r–r-- 1 sonarr media 3 Apr 25 10:43 sonarr.pid
[angelus@Angelus ~]$
[angelus@Angelus ~]$
[angelus@Angelus ~]$ ls -l /var/lib/sabnzbd
total 28
drwxr-xr-x 2 sabnzbd media 4096 Apr 25 10:43 admin
drwxr-xr-x 5 sabnzbd media 4096 Apr 19 18:47 Downloads
drwxr-xr-x 2 sabnzbd media 4096 Apr 16 17:47 logs
-rw------- 1 sabnzbd media 7624 Apr 25 10:43 sabnzbd.ini
-rw------- 1 sabnzbd media 7624 Apr 25 10:43 sabnzbd.ini.bak
[angelus@Angelus ~]$ id sonarr
uid=968(sonarr) gid=1002(media) groups=1002(media)
[angelus@Angelus ~]$ id sabnzbd
uid=967(sabnzbd) gid=1002(media) groups=1002(media)
[angelus@Angelus ~]$ id angelus
uid=1000(angelus) gid=1001(angelus) groups=1001(angelus),3(sys),998(wheel),984(users),982(rfkill),1000(autologin),1002(media)

if i could understand where i’m going wrong and how i hope then i can fix it. but i think if i restart now all what i did today will be gone because that is what happened last night :man_shrugging:

Can we see the output of lsblk -o NAME,SIZE,TYPE,MOUNTPOINT,FSTYPE,LABEL

My suspicion would be that whatever is mounted at /var/lib/sabnzbd and /var/lib/sonarr doesn’t support POSIX permissions.

1 Like

[angelus@Angelus ~]$ lsblk -o NAME,SIZE,TYPE,MOUNTPOINT,FSTYPE,LABEL
NAME SIZE TYPE MOUNTPOINT FSTYPE LABEL
sda 232.9G disk
└─sda1 232.9G part / ext4
sdb 232.9G disk isw_raid_member
└─sdb1 232.9G part /run/media/angelus/music ntfs music

edit: sorry for the wait on my reply was having supper

Is that ntfs partition symlinked or bind mounted to /var/lib/sonarr?

um not that i know of, its a internal drive that i put my music onto , its just there when i boot the system up … it should not have any link to sonarr

edit: i could just disconnect it to see if it causing trouble

There are two common things that would cause permissions to reset on every reboot that I can think of.

One is that you are using a filesystem like ntfs/fat/xfat which doesn’t support POSIX permissions in which case the permissions are being set by the mounting mechanism.

Another is if there is a process that resets the permissions on those directories as part of it’s operations. It seems like Sonarr is a server process so it is possible it is resetting the permissions on it’s directories.

yeah i thought maybe sonarr was maybe doing that but i really wasn’t sure i truly thought i did something wrong … i’ll do some more digging on that :ok_hand:

and i think it would be best for me to just either change that filesystem to ext4 and then just copy everything back

i truly appreciate your help … this is the furthest i have ever gotten with linux and i’m learning so much :+1:

1 Like

If sonarr is running from a systemd service, you could also check to see if it setting an explicit group in the service.

it runs as a service yes … and from what i recall it has sonarr as owner and then has a sonarr group … lol … if i right click on the /var/lib/sonarr folder its got sonarr as the group lol but i thought that i set that already to the media group

You can use systemctl to edit the service and change the group to media if that is what you want.

awesome thanks