Directory Permission Issues on 4.7 Beta 2?
Posted: Fri Jul 06, 2012 8:39 pm
Hello,
I'm using Subsonic 4.7 Beta 2 installed via the subsonic-4.7.beta2.deb package on a Ubuntu Server 12.04 x64 machine. This is a fresh install, not an upgrade.
From the "About Subsonic" page:
My java version:
I have Subsonic set to run as user "subsonic" via the necessary setting in the "/etc/default/subsonic" config file:
This user has been assigned the UID of 110 as shown in the "/etc/passwd" file:
This user has also been assigned secondary membership in a group called "music-data" as shown in the "/etc/group" file:
This is in addition to primary membership in the default "subsonic" group:
I have confirmed that Subsonic is running as the "subsonic" user:
This works:
When I add a Media Folder to Subsonic pointing to the "subsonic" user home folder ("/home/subsonic"), the Media Folder content shows up in Subsonic after the necessary Media Folder scan. The "subsonic" home folder contains a single directory containing music files and has the following permissions (the same permissions and ownership apply to all sub-directories and sub-files):
These files all show up in Subsonic and I can play them without any issues. As expected, I can also access all of these files from the command line as the "subsonic" user.
This does not work:
When I add a Media Folder to Subsonic pointing to a shared music directory owned by another user and the "music-data" group, the Media Folder content fails to show up in Subsonic, even after a Media Folder scan. The music directory has the following permissions and contains several tens of thousands of songs organized in various sub-directories (the same permissions and ownership apply to all sub-directories and sub-files):
These files do not show up in Subsonic. I am, however, able to access all of these files from the command line as the "subsonic" user.
Since the "subsonic" user is a member of the "music-data" group, and the group is given full permission (770) on the music directory and all sub-files and sub-directories, this should work. As you can see from the previous "ls" dump performed as the "subsonic" user, the user clearly has full access via the "music-data" group.
The Subsonic log does not provide any enlightenment:
I can resolve the issue by granting "other" read/execute permissions (775) on the music directory and all sub-directories and sub-files. But I would prefer not to do this, as I believe I should be able to make it work via only full group and owner permissions.
Edit: While though I had this working earlier with 775 permissions, when I try to duplicate it now It appears that even setting the read/execute permission to 775 do not resolve the issue...
Any ideas what I'm doing wrong, or why this is not working? I'm pretty sure I've used setups similar to this with previous (4.5 and before) versions of Subsonic without issue. Is this my mistake or a Subsonic bug?
Thanks,
Andy
I'm using Subsonic 4.7 Beta 2 installed via the subsonic-4.7.beta2.deb package on a Ubuntu Server 12.04 x64 machine. This is a fresh install, not an upgrade.
From the "About Subsonic" page:
- Code: Select all
Version: 4.7.beta2 (build 3011) – June 8, 2012
Server: jetty-6.1.x, java 1.7.0_03, Linux (112.0 MB / 198.4 MB)
My java version:
- Code: Select all
asayler@server:$ java -version
java version "1.7.0_03"
OpenJDK Runtime Environment (IcedTea7 2.1.1pre) (7~u3-2.1.1~pre1-1ubuntu3)
OpenJDK 64-Bit Server VM (build 22.0-b10, mixed mode)
I have Subsonic set to run as user "subsonic" via the necessary setting in the "/etc/default/subsonic" config file:
- Code: Select all
SUBSONIC_USER=subsonic
This user has been assigned the UID of 110 as shown in the "/etc/passwd" file:
- Code: Select all
subsonic:x:110:123::/home/subsonic:/bin/false
This user has also been assigned secondary membership in a group called "music-data" as shown in the "/etc/group" file:
- Code: Select all
music-data:x:1002:asayler,subsonic
This is in addition to primary membership in the default "subsonic" group:
- Code: Select all
subsonic:x:123:
I have confirmed that Subsonic is running as the "subsonic" user:
- Code: Select all
asayler@server:$ ps -al | grep 110
0 S 110 17884 1 1 80 0 - 812047 futex_ pts/0 00:00:25 java
This works:
When I add a Media Folder to Subsonic pointing to the "subsonic" user home folder ("/home/subsonic"), the Media Folder content shows up in Subsonic after the necessary Media Folder scan. The "subsonic" home folder contains a single directory containing music files and has the following permissions (the same permissions and ownership apply to all sub-directories and sub-files):
- Code: Select all
asayler@server:$ sudo -u subsonic ls -al /home/subsonic
total 20
drwxrwx--- 5 subsonic subsonic 4096 Jul 6 14:13 .
drwxr-xr-x 6 root root 4096 Jun 11 19:07 ..
drwxrwx--- 3 subsonic subsonic 4096 Jul 6 13:52 Battlefield Band, The
drwxrwx--- 2 subsonic subsonic 4096 Jun 11 19:28 .fontconfig
drwxrwx--- 3 subsonic subsonic 4096 Jun 11 19:28 .java
These files all show up in Subsonic and I can play them without any issues. As expected, I can also access all of these files from the command line as the "subsonic" user.
This does not work:
When I add a Media Folder to Subsonic pointing to a shared music directory owned by another user and the "music-data" group, the Media Folder content fails to show up in Subsonic, even after a Media Folder scan. The music directory has the following permissions and contains several tens of thousands of songs organized in various sub-directories (the same permissions and ownership apply to all sub-directories and sub-files):
- Code: Select all
asayler@server:$ sudo -u subsonic ls -al /data-store/music-store/
total 4
drwxrwxr-x 1 root music-data 58 Jan 20 22:02 .
drwxrwxr-x 1 root admin-data 66 Feb 9 14:07 ..
drwxrwxr-x 1 asayler music-data 122 Jul 1 23:38 asayler
drwxrwxr-x 1 asayler music-data 0 Jan 20 22:01 music
drwxrwxr-x 1 asayler music-data 0 Jan 20 22:02 playlists
drwxrwxr-x 1 asayler music-data 0 Jan 20 22:01 podcasts
These files do not show up in Subsonic. I am, however, able to access all of these files from the command line as the "subsonic" user.
Since the "subsonic" user is a member of the "music-data" group, and the group is given full permission (770) on the music directory and all sub-files and sub-directories, this should work. As you can see from the previous "ls" dump performed as the "subsonic" user, the user clearly has full access via the "music-data" group.
The Subsonic log does not provide any enlightenment:
- Code: Select all
asayler@server:$ sudo tail /var/subsonic/subsonic.log
[2012-07-06 13:56:44,360] INFO MusicFolderDao - Created music folder /data-store/music-store
[2012-07-06 13:56:44,378] INFO MediaScannerService - Automatic media library scanning scheduled to run every 1 day(s), starting at Sat Jul 07 05:00:00 MDT 2012
[2012-07-06 13:57:07,774] INFO MediaScannerService - Starting to scan media library.
[2012-07-06 13:57:09,279] INFO MediaScannerService - Scanned media library with 20 entries.
I can resolve the issue by granting "other" read/execute permissions (775) on the music directory and all sub-directories and sub-files. But I would prefer not to do this, as I believe I should be able to make it work via only full group and owner permissions.
Edit: While though I had this working earlier with 775 permissions, when I try to duplicate it now It appears that even setting the read/execute permission to 775 do not resolve the issue...
Any ideas what I'm doing wrong, or why this is not working? I'm pretty sure I've used setups similar to this with previous (4.5 and before) versions of Subsonic without issue. Is this my mistake or a Subsonic bug?
Thanks,
Andy