Koozali.org: home of the SME Server

Permissions problem slimserver

Offline Morgo

  • *
  • 16
  • +0/-0
Permissions problem slimserver
« on: August 19, 2007, 11:20:37 AM »
Hi all,
I installed Slimserver for music streaming from this howto http://www.sonoracomm.com/sonoracomm/pdf/slimserver_howto.pdf which went well. However when I log into the web ui and set my music location to the music ibay I have shared, I cannot see the songs. The debug options in the web ui tell me that slimserver cant access the ibay cause permission denied. I have set the permissions on the ibay to everyone read/write. Obviously I need to do something else can anyone help.

Morgo
Why doesn't anybody sing with an accent  ?????
 and
God Bless Linux ....

Offline sognenovski

  • ***
  • 64
  • +0/-0
Re: Permissions problem slimserver
« Reply #1 on: August 19, 2007, 10:54:46 PM »
Morgo

from my setup

Ibay
Name: music
Desription: music
Group: Everyone
User access: Write=group, Read=everyone
Public access: Local network(no password required)
Execution of dynamic: enabled

Point SlimServer to
/home/e-smith/files/ibays/music/files

Steve

Offline Morgo

  • *
  • 16
  • +0/-0
Re: Permissions problem slimserver
« Reply #2 on: August 21, 2007, 07:46:34 AM »
Hi Steve

Thanks for your reply. My setup is exactly the same as yours. I am using sme 7.1.3? Any further help would be appreciated. Paul
Why doesn't anybody sing with an accent  ?????
 and
God Bless Linux ....

Offline jdc0730

  • **
  • 29
  • +0/-0
Re: Permissions problem slimserver
« Reply #3 on: August 28, 2007, 09:38:10 PM »
Hi Steve

Thanks for your reply. My setup is exactly the same as yours. I am using sme 7.1.3? Any further help would be appreciated. Paul

So I have had slimserver running for quite a while but don't have my music files stored in an ibay, they are stored on a large RAID array that existed before I implemented SME.  That being said, I thought I would try to help.

Can you tell me what file location you are putting into slimserver?  Also can you list could the permissions of the directory as will as an example file in the directory? 

Offline Morgo

  • *
  • 16
  • +0/-0
Re: Permissions problem slimserver
« Reply #4 on: September 05, 2007, 12:44:46 PM »
Hi JDC
Thanks for the reply, sorry took so long to reply, did not have notifications on. I point the set up to the files located here /home/e-smith/files/ibays/music/files. At this level I cannot see anything. If I go up a level e.g.  /home/e-smith/files/ibays/music I can see the contents (files, html, cgi-bin), so I'm deffinantley pointing in the right direction. If I debug I get 
2007-09-05 20:34:18.3552 opendir failed: /home/e-smith/files/ibays/music/files: Permission denied
I can read and write from the lan directly into /home/e-smith/files/ibays/music/files but I cannot do it through slimserver ! any ideas.
Why doesn't anybody sing with an accent  ?????
 and
God Bless Linux ....

Offline jdc0730

  • **
  • 29
  • +0/-0
Re: Permissions problem slimserver
« Reply #5 on: September 05, 2007, 01:53:53 PM »
Hi JDC
Thanks for the reply, sorry took so long to reply, did not have notifications on. I point the set up to the files located here /home/e-smith/files/ibays/music/files. At this level I cannot see anything. If I go up a level e.g.  /home/e-smith/files/ibays/music I can see the contents (files, html, cgi-bin), so I'm deffinantley pointing in the right direction. If I debug I get 
2007-09-05 20:34:18.3552 opendir failed: /home/e-smith/files/ibays/music/files: Permission denied
I can read and write from the lan directly into /home/e-smith/files/ibays/music/files but I cannot do it through slimserver ! any ideas.


Couple of things that would be helpful (and if I am being too descriptive, I apologize):

What is the user name under which slimserver is running? (ps -ef | grep slimserver)

Can you provide the permission string for the ibay directory? (cd /home/e-smith/files/ibays/music/; ls -l)

Can you provide the permission string for a file in that directory? (cd /home/e-smith/files/ibays/music/files; ls -l | tail -1)

The only thing I could guess is than the user that is running slimserver doesn't have permission.  The other thing to check is the slimserver.log.  I am not at home at the moment, but I believe it gets written to /tmp.  Turning on the "d_scan" option under debugging within Slimserver might also reviel something.

Jeff

Offline jdc0730

  • **
  • 29
  • +0/-0
Re: Permissions problem slimserver
« Reply #6 on: September 05, 2007, 02:00:07 PM »
Quote
The other thing to check is the slimserver.log.  I am not at home at the moment, but I believe it gets written to /tmp.  Turning on the "d_scan" option under debugging within Slimserver might also reviel something.

Just noticed to can access the log via the Debugging screen within slimserver as well.  You will need to turn on debugging first.

Offline Morgo

  • *
  • 16
  • +0/-0
Re: Permissions problem slimserver
« Reply #7 on: September 06, 2007, 01:43:14 AM »
Hi Jeff
Thanks for the reply. Here is out put from ps -ef | grep slimserver

 ps -ef | grep slimserver
5010     10879     1  0 Aug20 ?        00:09:16 /usr/bin/perl -w /usr/local/slimserver/slimserver.pl --daemon --prefsfile=/etc/slimserver.conf --logfile=/tmp/slimserver.log
5010     10882 10879  0 Aug20 ?        00:00:00 /usr/local/slimserver/Bin/i386-linux/mysqld --defaults-file=/usr/local/slimserver/Cache/my.cnf
5010     10883 10882  0 Aug20 ?        00:00:10 /usr/local/slimserver/Bin/i386-linux/mysqld --defaults-file=/usr/local/slimserver/Cache/my.cnf
5010     10884 10883  0 Aug20 ?        00:00:00 /usr/local/slimserver/Bin/i386-linux/mysqld --defaults-file=/usr/local/slimserver/Cache/my.cnf
5010     10885 10883  0 Aug20 ?        00:00:00 /usr/local/slimserver/Bin/i386-linux/mysqld --defaults-file=/usr/local/slimserver/Cache/my.cnf
5010     10886 10883  0 Aug20 ?        00:00:00 /usr/local/slimserver/Bin/i386-linux/mysqld --defaults-file=/usr/local/slimserver/Cache/my.cnf
5010     10887 10883  0 Aug20 ?        00:00:00 /usr/local/slimserver/Bin/i386-linux/mysqld --defaults-file=/usr/local/slimserver/Cache/my.cnf
5010     10889 10883  0 Aug20 ?        00:11:07 /usr/local/slimserver/Bin/i386-linux/mysqld --defaults-file=/usr/local/slimserver/Cache/my.cnf
5010     10890 10883  0 Aug20 ?        00:11:20 /usr/local/slimserver/Bin/i386-linux/mysqld --defaults-file=/usr/local/slimserver/Cache/my.cnf
5010     10891 10883  0 Aug20 ?        00:00:00 /usr/local/slimserver/Bin/i386-linux/mysqld --defaults-file=/usr/local/slimserver/Cache/my.cnf
5010     10892 10883  0 Aug20 ?        00:00:00 /usr/local/slimserver/Bin/i386-linux/mysqld --defaults-file=/usr/local/slimserver/Cache/my.cnf
5010     10903     1  0 Aug20 ?        00:00:00 /usr/local/slimserver/Bin/i386-linux/mDNSResponderPosix -d -f /usr/local/slimserver/Cache/mDNS.conf -P /usr/local/slimserver/Cache/mDNS.pid


Here is the out put from ls -l

ls -l
total 92
drwxrws---    2 root shared  4096 Apr  5  2006 cgi-bin
drwxrws---  306 root shared 81920 Aug 29 17:24 files
drwxrws---    2 root shared  4096 Jan 10  2007 html

Here is the out put from ls -l | tail -1

ls -l | tail -1
drwxrws---   3 themorgans shared     4096 Jan 13  2007 Young Divas

Here is the output from d scan

2007-09-06 09:35:44.5565 Setup::rescan - initiating scan of type: [rescan]
2007-09-06 09:35:48.1407 opendir failed: /home/e-smith/files/ibays/music/files: Permission denied

I agree with you that it probably is a slimserver permission but I dont know linux well enough to sort it ! Does slimserver need to be a member of the everybody group (does that make sense).

Thanks

Paul
Why doesn't anybody sing with an accent  ?????
 and
God Bless Linux ....

Offline jdc0730

  • **
  • 29
  • +0/-0
Re: Permissions problem slimserver
« Reply #8 on: September 06, 2007, 03:59:45 AM »
Okay, I am going to give you an overly complicated answer to a relatively simple fix (or at least what appears to be), but I don't like getting answers that I don't understand.

Slimserver, by default, runs under the user name "slimserver".  That user name doesn't exist on your system.  That is what the "5010" is in first column of the process listing.  Since you system doesn't know who slimserver is, it uses a number to keep track.

Your permissions are set to allow creator and groups to have full access to your directory (your permission string "drwxrws---").  The last three permissions indicate that if you aren't the creator or in the group, you can't do anything.  That is the problem slimserver is having.

So unfortunately, I think the best solution is the one I haven't tried.  You need to get slimserver to run as a user on the system.  That can be accomplished one of two ways, 1) add the user "slimserver" to your system or 2) make slimserver run as a user on the system.  1) can be done through the web interface.  If you add slimserver, you should just have to restart slimserver to get it to work.  2) will need to be done by editing the /etc/sysconfig/slimserver file, which has a variable in it called SLIMSERVER_USER.  You would just need to change that to a user on the system that can read the files (like www).  These are the more elegant solutions, but I haven't tested either.  If your problem is as described, that should solve it.  You will know you have done it right if after restarting slimserver you have a name in the "ps -ef | grep slimserver" listing and not a number.

The second option would be the brute force one. You could add the read permission to the directory and the files in that ibay.  This could be done with the following:

find /home/e-smith/files/ibays/music/files -type d -exec chmod o+rx "{}" \;
find /home/e-smith/files/ibays/music/files -type f -exec chmod o+r "{}" \;

This gives read and execute permissions to all the directories it finds under the ibay (1) and read permission to all the files under the ibay (2).  The one problem you will have with this set up is that all new files added to the directory will likely not be readable without changing the permissions again.

So try the first option and let me know how it goes.

Offline Morgo

  • *
  • 16
  • +0/-0
Re: Permissions problem slimserver
« Reply #9 on: September 06, 2007, 07:08:36 AM »
Hi Jeff

I have previously tried to add the user slimserver through the web interface but it returns the error that there is already a system account of that name. I went to /etc/sysconfig/slimserver as you suggested and changed the SLIMSERVER_USER to a system user name, and it stopped any access through a browser to slimserver.
I did "ps -ef | grep slimserver" after i changed the SLIMSERVER_USER and i got this output

ps -ef | grep slimserver
root      4636  4539  0 15:05 pts/0    00:00:00 grep slimserver

The brute force option would be a bit pointless for me because the kids are always adding album folders.

Thanks
Paul
Why doesn't anybody sing with an accent  ?????
 and
God Bless Linux ....

Offline jdc0730

  • **
  • 29
  • +0/-0
Re: Permissions problem slimserver
« Reply #10 on: September 06, 2007, 11:57:10 AM »
Change it back to slimserver in /etc/sysconfig/slimserver and do "usermod -G shared slimserver".  That will add slimserver to the "shared" group. 

Didn't realize it created the user automatically.  That's what I get for giving advice from memory.

Jeff

Offline Morgo

  • *
  • 16
  • +0/-0
Re: Permissions problem slimserver
« Reply #11 on: September 07, 2007, 01:55:08 AM »
Hi Jeff

That worked, I can see the files now, thanks. I should be able to play the songs through the browser right ? Seems to be playing but I have no sound.
Why doesn't anybody sing with an accent  ?????
 and
God Bless Linux ....

Offline jdc0730

  • **
  • 29
  • +0/-0
Re: Permissions problem slimserver
« Reply #12 on: September 07, 2007, 02:14:13 AM »
Hi Jeff

That worked, I can see the files now, thanks. I should be able to play the songs through the browser right ? Seems to be playing but I have no sound.

You don't actually play through the browser.  You queue up the playlist and play the stream my pointing your media player to http://<slimserver address>/stream.mp3