Home of the Squeezebox™ & Transporter® network music players.
Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Member
    Join Date
    Jun 2017
    Location
    Belgium
    Posts
    86

    LMS on Debian server: file permissions

    Hi guys, could use some help here.

    I moved LMS from a RPi to a Debian Buster LXC which, overall, is a big improvement:
    - scrolling/searching tracks is much faster
    - BT pairing on the zero also is much faster and playback is more in sync
    - the main RPi with LCD has some hiccups and rebooting doesn't influence LMS/playback anymore

    The only thing is that I have some issues with file permissions and I'm not a Linux expert at all.
    - I cannot save playlists from squeezer or the LMS web UI
    - syncing the music folder with Syncback or Robocopy from my desktop towards the SMB share works but Robocopy prompts as if the files are new, even if they already exist.

    My setup is a Proxmox server with a LXC which runs Debian Buster, Samba and LMS.
    The share is on a bindmounted host HD.

    TIA
    pCP v5.0.0 on all players
    LMS 7.9.2 on Debian Buster server in a Linux Container
    RPi 3B+ with Hifiberry AMP2 and official 7" touchscreen (Squeezelite + Jivelite), +27k titles on SMB share
    RPi B as dedicated player, connected over wifi with USB dongle
    RPi 2B as dedicated player, connected over powerline
    RPi Zero W as dedicated player
    Squeezer on Android to control

  2. #2
    Senior Member
    Join Date
    Apr 2005
    Location
    UK/London
    Posts
    2,085
    Probably the easiest to solve is the playlists issue.
    From LMS web UI, check to see where you have configured playlists to be saved and then have a look to see if the location exists and, if it does, what the permissions are.

    ls -l
    will show you the permission.
    chown and chgrp to change them to match what LMS is running as (or cheat and make them r/w accessible to everyone)
    Paul Webster
    http://dabdig.blogspot.com
    Author Radio France (FIP etc) plugin

  3. #3
    Member
    Join Date
    Jun 2017
    Location
    Belgium
    Posts
    86
    Hi Paul, thanks for your quick response!

    All music is on a subfolder of the SMB share, the playlists are in a seperate folder under same subfolder.
    This is part of the output of that ls -l command:
    Code:
    drwxr-xr-x   2 <Win desktop user> <Win desktop user>      46 Dec 26 12:11  0_Playlists
    drwxr-xr-x   5 <Win desktop user> <Win desktop user>     219 Nov 17 13:11  1_Various
    That <Win desktop user> user also exist as a linux user with same credentials.

    I think LMS is running as root...
    pCP v5.0.0 on all players
    LMS 7.9.2 on Debian Buster server in a Linux Container
    RPi 3B+ with Hifiberry AMP2 and official 7" touchscreen (Squeezelite + Jivelite), +27k titles on SMB share
    RPi B as dedicated player, connected over wifi with USB dongle
    RPi 2B as dedicated player, connected over powerline
    RPi Zero W as dedicated player
    Squeezer on Android to control

  4. #4
    Senior Member
    Join Date
    Aug 2012
    Location
    Austria
    Posts
    963
    Quote Originally Posted by Rnee View Post

    All music is on a subfolder of the SMB share, the playlists are in a seperate folder under same subfolder.
    This is part of the output of that ls -l command:
    Code:
    drwxr-xr-x   2 <Win desktop user> <Win desktop user>      46 Dec 26 12:11  0_Playlists
    drwxr-xr-x   5 <Win desktop user> <Win desktop user>     219 Nov 17 13:11  1_Various
    That <Win desktop user> user also exist as a linux user with same credentials.
    The <Win desktop user> is a red herring in this context - only the linux user / groupis relevant (unless Samba Active Directory is used, which is unlikely)

    I think LMS is running as root...
    I certainly hope it isn't - check with ps -ef|grep squee

    Anyway, the simplest approach is to make 0_Playlists group writeable and and set the SGID bit on it (chmod 2775 0_Playlists), then add the user LMS is running as (ususally squeezeboxserver) to the group owning 0_Playlists (usermod -aG < 0_Playlists owning group> squeezeboxserver)
    Various SW: Web Interface | Playlist Editor / Generator | Music Classification | Similar Music | Announce | EventTrigger | LMSlib2go | ...
    Various HowTos: build a self-contained LMS | Bluetooth/ALSA | Control LMS with any device | ...

  5. #5
    Member
    Join Date
    Jun 2017
    Location
    Belgium
    Posts
    86
    Hi Roland, I'm aware that the <Win desktop user> doesn't have anything to do with Linux, I wrote this because syncing the musicfolder also doesn't go very well.
    Just for ease of use, I have created the same user on Linux.

    Quote Originally Posted by Roland0 View Post
    I certainly hope it isn't - check with ps -ef|grep squee
    I thought so since I did install under root, this is the output:
    Code:
    root@v-srv:~# ps -ef|grep squee
    squeeze+    83     1  0 Dec24 ?        00:00:00 /bin/bash /usr/sbin/squeezeboxserver_safe /usr/sbin/squeezeboxserver --prefsdir /var/lib/squeezeboxserver/prefs --logdir /var/log/squeezeboxserver/ --cachedir /var/lib/squeezeboxserver/cache --charset=utf8
    squeeze+    96    83  0 Dec24 ?        00:05:37 /usr/bin/perl /usr/sbin/squeezeboxserver /usr/sbin/squeezeboxserver /usr/sbin/squeezeboxserver --prefsdir /var/lib/squeezeboxserver/prefs --logdir /var/log/squeezeboxserver/ --cachedir /var/lib/squeezeboxserver/cache --charset=utf8
    root      2590  2575  0 11:04 pts/2    00:00:00 grep squee
    root@v-srv:~# less /etc/passwd
    root@v-srv:~# less /etc/passwd | grep squ
    squeezeboxserver:x:107:65534:Logitech Media Server,,,:/usr/share/squeezeboxserver:/usr/sbin/nologin
    So is it 'squeeze+', and what is 'squeezeboxserver'?
    Does that '+' just indicate that there is more text?
    If I use 'top', I also see that 'squeeze+'...

    Quote Originally Posted by Roland0 View Post
    Anyway, the simplest approach is to make 0_Playlists group writeable and and set the SGID bit on it (chmod 2775 0_Playlists), then add the user LMS is running as (ususally squeezeboxserver) to the group owning 0_Playlists (usermod -aG < 0_Playlists owning group> squeezeboxserver)
    This goes above my head, have to look into it.
    Simplest but not 'the right' approach?
    pCP v5.0.0 on all players
    LMS 7.9.2 on Debian Buster server in a Linux Container
    RPi 3B+ with Hifiberry AMP2 and official 7" touchscreen (Squeezelite + Jivelite), +27k titles on SMB share
    RPi B as dedicated player, connected over wifi with USB dongle
    RPi 2B as dedicated player, connected over powerline
    RPi Zero W as dedicated player
    Squeezer on Android to control

  6. #6
    Senior Member
    Join Date
    Aug 2012
    Location
    Austria
    Posts
    963
    Quote Originally Posted by Rnee View Post
    Hi Roland, I'm aware that the <Win desktop user> doesn't have anything to do with Linux, I wrote this because syncing the musicfolder also doesn't go very well.
    Not sure what you mean by "syncing"

    Just for ease of use, I have created the same user on Linux.
    imo, this just leads to confusion. ymmv.


    So is it 'squeeze+', and what is 'squeezeboxserver'?
    Does that '+' just indicate that there is more text?
    Yes (LMS runs as user squeezeboxserver)

    This goes above my head, have to look into it.
    Well, it's two commands, both of which I've supplied - you'll just have to replace <0_Playlists owning group> with the group owning 0_Playlists (as you didn't supply that information).

    Simplest but not 'the right' approach?
    You could have used the squeezeboxserver user as local samba user for the share, some may consider this simpler
    Various SW: Web Interface | Playlist Editor / Generator | Music Classification | Similar Music | Announce | EventTrigger | LMSlib2go | ...
    Various HowTos: build a self-contained LMS | Bluetooth/ALSA | Control LMS with any device | ...

  7. #7
    Senior Member SpiderJon's Avatar
    Join Date
    Dec 2008
    Location
    Cardiff, Wales, UK
    Posts
    122
    Quote Originally Posted by Rnee View Post
    Hi guys, could use some help here.

    I moved LMS from a RPi to a Debian Buster LXC which, overall, is a big improvement:
    Just curious - What hardware are you running it on?

  8. #8
    Member
    Join Date
    Jun 2017
    Location
    Belgium
    Posts
    86
    Quote Originally Posted by Roland0 View Post
    Not sure what you mean by "syncing"
    To have a backup from my music collection + the fact that I make changes regularly since I have quite a lot single tracks that need some work, I work on the folder located on my desktop PC.
    From there, I sync with Syncback or Robocopy towards the networkshare.

    Quote Originally Posted by Roland0 View Post
    imo, this just leads to confusion. ymmv.
    Just by creating a Linux user with same name/password as the Windows user of my desktop, I thought of making it simple/easier.

    Quote Originally Posted by Roland0 View Post
    Yes (LMS runs as user squeezeboxserver)
    So to be able to save playlists from the LMS interface, I have to give that user write access to the playlist folder, right?
    This seems to be what you are explaining hereafter...
    Quote Originally Posted by Roland0 View Post
    Well, it's two commands, both of which I've supplied - you'll just have to replace <0_Playlists owning group> with the group owning 0_Playlists (as you didn't supply that information).

    Quote Originally Posted by Roland0 View Post
    You could have used the squeezeboxserver user as local samba user for the share, some may consider this simpler
    I have installed LMS on the same machine as Samba so I can access that folder directly through the filesystem instead of through the share.
    The disk is passed on (bind mounted) from the host to the LXC running LMS/Samba.

    @SpiderJon: it's a Dell Optiplex 7010 SFF, i3 - 2c/4t, 16Gb Ram, SSD for OS/VM/LXC's, HDD for data.
    Ideal for my situation, it's small, quiet and has enough power.

    EDIT:
    I created a group, added users squeezeboxserver & pcp (don't remember why I created that, maybe because I thought I needed that since this is the user on squeezelite?) & the Linux user with the same name/pw as the Win user.
    Changed group ownership of the '0_Playlists' folder with that group.
    Only if I change the folder permissions to 777 I can save a playlist to that folder.
    Last edited by Rnee; 2019-12-27 at 15:35. Reason: added info
    pCP v5.0.0 on all players
    LMS 7.9.2 on Debian Buster server in a Linux Container
    RPi 3B+ with Hifiberry AMP2 and official 7" touchscreen (Squeezelite + Jivelite), +27k titles on SMB share
    RPi B as dedicated player, connected over wifi with USB dongle
    RPi 2B as dedicated player, connected over powerline
    RPi Zero W as dedicated player
    Squeezer on Android to control

  9. #9
    Senior Member
    Join Date
    Aug 2012
    Location
    Austria
    Posts
    963
    Quote Originally Posted by Rnee View Post
    Just by creating a Linux user with same name/password as the Windows user of my desktop, I thought of making it simple/easier.
    As I said, I think it muddies the waters - e.g. people tend to assume it's the "same user" when it is not, and both have the same properties (e.g. password, permissions etc.) when they may not (e.g if you change the linux user's password, the samba user's will not be updated in a typical samba installation)

    So to be able to save playlists from the LMS interface, I have to give that user write access to the playlist folder, right?
    Yes

    I created a group,
    That's not what I suggested. Why do you need a new group?

    added users squeezeboxserver & pcp (don't remember why I created that, maybe because I thought I needed that since this is the user on squeezelite?) & the Linux user with the same name/pw as the Win user.
    What does squeezelite have to do with anything here? Does it run on the same server?

    Changed group ownership of the '0_Playlists' folder with that group.
    DId you set the SGID bit on the folder?

    Only if I change the folder permissions to 777 I can save a playlist to that folder.
    Which user/group/permissions do files created in it by either LMS or Samba have?
    Various SW: Web Interface | Playlist Editor / Generator | Music Classification | Similar Music | Announce | EventTrigger | LMSlib2go | ...
    Various HowTos: build a self-contained LMS | Bluetooth/ALSA | Control LMS with any device | ...

  10. #10
    Member
    Join Date
    Jun 2017
    Location
    Belgium
    Posts
    86
    Thanks for clarifying things Roland! ;-)

    Quote Originally Posted by Roland0 View Post
    As I said, I think it muddies the waters - e.g. people tend to assume it's the "same user" when it is not, and both have the same properties (e.g. password, permissions etc.) when they may not (e.g if you change the linux user's password, the samba user's will not be updated in a typical samba installation)
    You're right and I know that it's not the same user, I did this to make things easier as in accessing without having to provide credentials.

    Quote Originally Posted by Roland0 View Post
    That's not what I suggested. Why do you need a new group?
    To be able to assign permissions to multiple users...

    Quote Originally Posted by Roland0 View Post
    What does squeezelite have to do with anything here? Does it run on the same server?
    Nothing, I know that now. I thought that pcp/squeezelite somehow was in between there.

    Quote Originally Posted by Roland0 View Post
    DId you set the SGID bit on the folder?
    No, have to look into this: you've explained 2 ways and I'm eager to know what the right way is.

    Quote Originally Posted by Roland0 View Post
    Which user/group/permissions do files created in it by either LMS or Samba have?
    LMS
    Code:
    -rw-r--r-- 1 squeezeboxserver nogroup      1725 Dec 29 13:22  test.m3u
    Samba
    Code:
    -rwxr--r-- 1 <win/samba user> <win/samba user>     0 Dec 29 13:18  test.txt
    pCP v5.0.0 on all players
    LMS 7.9.2 on Debian Buster server in a Linux Container
    RPi 3B+ with Hifiberry AMP2 and official 7" touchscreen (Squeezelite + Jivelite), +27k titles on SMB share
    RPi B as dedicated player, connected over wifi with USB dongle
    RPi 2B as dedicated player, connected over powerline
    RPi Zero W as dedicated player
    Squeezer on Android to control

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •