PDA

View Full Version : SlimServer 6.1.1 not writing config settings?



neurophyre
2005-10-07, 13:13
I've got SlimServer 6.1.1 running on a Debian 3.1 box using the instructions and files from http://www.holmlund.se/slim/ and it installed and started working fine last night.

When logrotate stopped slimserver briefly to rotate the log files this morning, it came back up fine and when my Squeezebox2 arrived this afternoon I discovered that SlimServer had forgotten ALL settings, including the path to my music repository, the username and password I'd set, and so forth.

I've gotten it reconfigured now, but slimserver.conf does not exist anywhere on my system (I ran 'updatedb' and then used 'locate' to look for it). There is nothing in the /etc/slimserver directory which was created according to the install instructions from the above-mentioned Debian site, and is owned by the slimserver user. .slimserversql.db is in /var/tmp/slimserver.

This is happening any time Slimserver is restarted. It forgets all config settings, although the .slimserversql.db file is not deleted. This includes forgetting all my Internet radio favorites (annoying) and my username and password for SlimServer (a major security hole). Any ideas? Where should slimserver.conf be being written?

mherger
2005-10-08, 00:27
> I've gotten it reconfigured now, but slimserver.conf does not exist
> anywhere on my system

Search for /etc/slimserver*, /root/slimserver* and /root/.slimserver*
(I'm generally using find for this).

Please report back what you find.

--

Michael

-----------------------------------------------------------
Help translate SlimServer by using the
StringEditor Plugin (http://www.herger.net/slim/)

Mattias Holmlund
2005-10-08, 05:20
On 10/7/05, neurophyre <neurophyre.1wjtb0 (AT) no-mx (DOT) forums.slimdevices.com> wrote:
>
> I've got SlimServer 6.1.1 running on a Debian 3.1 box using the
> instructions and files from http://www.holmlund.se/slim/ and it
> installed and started working fine last night.
>
> When logrotate stopped slimserver briefly to rotate the log files this
> morning, it came back up fine and when my Squeezebox2 arrived this
> afternoon I discovered that SlimServer had forgotten ALL settings,
> including the path to my music repository, the username and password
> I'd set, and so forth.
>
> I've gotten it reconfigured now, but slimserver.conf does not exist
> anywhere on my system (I ran 'updatedb' and then used 'locate' to look
> for it). There is nothing in the /etc/slimserver directory which was
> created according to the install instructions from the above-mentioned
> Debian site, and is owned by the slimserver user. .slimserversql.db is
> in /var/tmp/slimserver.
>
> This is happening any time Slimserver is restarted. It forgets all
> config settings, although the .slimserversql.db file is not deleted.
> This includes forgetting all my Internet radio favorites (annoying) and
> my username and password for SlimServer (a major security hole). Any
> ideas? Where should slimserver.conf be being written?
>

I started looking into this problem and saw that I don't have any file
called /etc/slimserver/slimserver.pref, even though I am running with
--prefsfile /etc/slimserver/slimserver.pref:

mattias@sto:~$ ps aux | grep slimserver
slimser 1072 0.0 0.2 2476 1180 ? Ss Sep27 0:00 /bin/sh
/opt/slimserver/platforms/debian/slimserver_safe
/opt/slimserver/server/slimserver.pl --prefsfile
/etc/slimserver/slimserver.pref --logfile
/var/log/slimserver/slimserver.log --cachedir /var/tmp/slimserver/
slimser 1076 0.4 8.8 48620 45552 ? S Sep27 73:30
/usr/bin/perl -w /opt/slimserver/server/slimserver.pl --prefsfile
/etc/slimserver/slimserver.pref --logfile
/var/log/slimserver/slimserver.log --cachedir /var/tmp/slimserver/
slimser 1153 0.0 0.1 1572 548 ? Ss Sep27 0:00
/mnt/hde1/home/mattias/nobackup/slimdevices/trunk/server/Bin/i386-linux/mDNSResponderPosix
-d -f /var/tmp/slimserver/mDNS.conf -P /var/tmp/slimserver/mDNS.pid

Does --prefsfile work?

/Mattias

mherger
2005-10-08, 07:35
> I started looking into this problem and saw that I don't have any file
> called /etc/slimserver/slimserver.pref, even though I am running with
> --prefsfile /etc/slimserver/slimserver.pref:

Does the slimserver user have the right to write to /etc/? You might want
to "touch /etc/slimserver.pref" as root, than "chown slimserver:slimserver
/etc/slimserver.pref" to be sure the file exists and is accessible for the
slimserver user.

--

Michael

-----------------------------------------------------------
Help translate SlimServer by using the
StringEditor Plugin (http://www.herger.net/slim/)

max.spicer
2005-10-08, 08:19
(Jumping in without reading rest of the thread)

I'd recommend creating /etc/slimserver/ and putting slim files in their. That way you can make the directory owned by the slimserver user and not have to worry about loosening the permissions on etc.

I've a feeling this recommendation was originally given to me by Michael.

Max


> I started looking into this problem and saw that I don't have any file
> called /etc/slimserver/slimserver.pref, even though I am running with
> --prefsfile /etc/slimserver/slimserver.pref:

Does the slimserver user have the right to write to /etc/? You might want
to "touch /etc/slimserver.pref" as root, than "chown slimserver:slimserver
/etc/slimserver.pref" to be sure the file exists and is accessible for the
slimserver user.

--

Michael

-----------------------------------------------------------
Help translate SlimServer by using the
StringEditor Plugin (http://www.herger.net/slim/)

Mattias Holmlund
2005-10-08, 15:47
On 10/8/05, max. spicer <max.spicer.1wlabb (AT) no-mx (DOT) forums.slimdevices.com> wrote:
>
> (Jumping in without reading rest of the thread)
>
> I'd recommend creating /etc/slimserver/ and putting slim files in
> their. That way you can make the directory owned by the slimserver
> user and not have to worry about loosening the permissions on etc.
>

That is exactly what I have done:

mattias@sto:~$ ls -ld /etc/slimserver
drwxr-xr-x 2 slimserver root 4096 2005-09-12 12:22 /etc/slimserver

and I use --prefsfile /etc/slimserver/slimserver.pref and slimserver
runs as user slimserver. But still, the configuration-file is not
written.

/Mattias

neurophyre
2005-10-10, 18:45
On 10/8/05, max. spicer <max.spicer.1wlabb (AT) no-mx (DOT) forums.slimdevices.com> wrote:
>
> (Jumping in without reading rest of the thread)
>
> I'd recommend creating /etc/slimserver/ and putting slim files in
> their. That way you can make the directory owned by the slimserver
> user and not have to worry about loosening the permissions on etc.
>

That is exactly what I have done:

mattias@sto:~$ ls -ld /etc/slimserver
drwxr-xr-x 2 slimserver root 4096 2005-09-12 12:22 /etc/slimserver

and I use --prefsfile /etc/slimserver/slimserver.pref and slimserver
runs as user slimserver. But still, the configuration-file is not
written.

/Mattias

Same here, which is what led me to post originally.

datacube:~# ls -ld /etc/slimserver/
drwxr-xr-x 2 slimserver root 4096 Oct 6 18:51 /etc/slimserver/

I am also running with --prefsfile /etc/slimserver/slimserver.pref, verified by 'ps'.

The slimserver user can definitely write to /etc/slimserver:

datacube:~# su slimserver -s /bin/bash
slimserver@datacube:/root$ cat > /etc/slimserver/blah
whee.
slimserver@datacube:/root$ ls -l /etc/slimserver/
total 4
-rw-r--r-- 1 slimserver nogroup 6 Oct 10 21:43 blah
slimserver@datacube:/root$

stinga
2005-10-10, 23:13
On 11/10/05 02:45:00, neurophyre wrote:

> Same here, which is what led me to post originally.
>
> datacube:~# ls -ld /etc/slimserver/
> drwxr-xr-x 2 slimserver root 4096 Oct 6 18:51 /etc/slimserver/
>
> I am also running with --prefsfile /etc/slimserver/slimserver.pref,
> verified by 'ps'.
>
> The slimserver user can definitely write to /etc/slimserver:
>
> datacube:~# su slimserver -s /bin/bash
> slimserver@datacube:/root$ cat > /etc/slimserver/blah
> whee.
> slimserver@datacube:/root$ ls -l /etc/slimserver/
> total 4
> -rw-r--r-- 1 slimserver nogroup 6 Oct 10 21:43 blah
> slimserver@datacube:/root$
>


Whilst you have proven you can create a file in /etc/slimserver you
have not proven that you can write to /etc/slimserver/slimserver.pref
Can you post the output of...
ls -l /etc/slimserver/slimserver.pref
and
ps -eafw|grep slimserver

neurophyre
2005-10-12, 08:32
datacube:~# ls -l /etc/slimserver/slimserver.pref
ls: /etc/slimserver/slimserver.pref: No such file or directory
datacube:~# ps -eafw | grep slimserver
slimser 25081 1 0 Oct07 ? 00:00:00 /bin/sh /opt/slimserver/platforms/debian/slimserver_safe /opt/slimserver/slimserver.pl --prefsfile /etc/slimserver/slimserver.pref --logfile /var/log/slimserver/slimserver.log --cachedir /var/tmp/slimserver/
slimser 25083 25081 0 Oct07 ? 00:31:17 /usr/bin/perl -w /opt/slimserver/slimserver.pl --prefsfile /etc/slimserver/slimserver.pref --logfile /var/log/slimserver/slimserver.log --cachedir /var/tmp/slimserver/
slimser 25085 1 0 Oct07 ? 00:00:00 /opt/SlimServer_v6.1.1/Bin/i386-linux/mDNSResponderPosix -d -f /var/tmp/slimserver/mDNS.conf -P /var/tmp/slimserver/mDNS.pid
root 26262 26256 0 11:34 pts/0 00:00:00 grep slimserver
datacube:~#

neurophyre
2005-10-24, 11:05
I've upgraded to the 10/24 nightly, which is now at least providing a helpful log message:

2005-10-24 14:01:28 slimserver_safe started.
2005-10-24 14:01:31.9606 Cannot write to preferences file /etc/slimserver/slimserver.pref, any changes made will not be preserved for the next startup of the server

The slimserver process is running as the user 'slimserver':

datacube:/opt# ps aux | grep slim
root 29642 0.0 0.5 1748 552 pts/1 S+ 14:03 0:00 tail -f slimserver.log
slimser 29665 0.0 0.9 2292 1064 ? Ss 14:05 0:00 /bin/sh /opt/slimserver/platforms/debian/slimserver_safe /opt/slimserver/slimserver.pl --prefsfile /etc/slimserver/slimserver.pref --logfile /var/log/slimserver/slimserver.log --cachedir /var/tmp/slimserver/
slimser 29667 0.0 33.9 39620 37424 ? S 14:05 0:07 /usr/bin/perl -w /opt/slimserver/slimserver.pl --prefsfile /etc/slimserver/slimserver.pref --logfile /var/log/slimserver/slimserver.log --cachedir /var/tmp/slimserver/
slimser 29669 0.0 0.4 1572 536 ? Ss 14:05 0:00 /opt/SlimServer_v2005-10-24/Bin/i386-linux/mDNSResponderPosix -d -f /var/tmp/slimserver/mDNS.conf -P /var/tmp/slimserver/mDNS.pid
root 29680 0.0 0.4 1552 476 pts/2 R+ 14:08 0:00 grep slim

And /etc/slimserver is as such:

datacube:/opt# ls -ld /etc/slimserver/
drwxr-xr-x 2 slimserver root 4096 Oct 24 14:01 /etc/slimserver/

Further, as demonstrated above, I can su to the slimserver user (forcing its shell to be /bin/bash) and create and write files in that directory just fine.

Any insight would be appreciated.

stinga
2005-10-24, 11:22
On 24/10/05 19:05:16, neurophyre wrote:
>
> I've upgraded to the 10/24 nightly, which is now at least providing a
> helpful log message:
>
> 2005-10-24 14:01:28 slimserver_safe started.
> 2005-10-24 14:01:31.9606 Cannot write to preferences file
> /etc/slimserver/slimserver.pref, any changes made will not be
> preserved
> for the next startup of the server
>
> The slimserver process is running as the user 'slimserver':
>
> datacube:/opt# ps aux | grep slim
> root 29642 0.0 0.5 1748 552 pts/1 S+ 14:03 0:00 tail -
> f
> slimserver.log
> slimser 29665 0.0 0.9 2292 1064 ? Ss 14:05 0:00 /bin/
> sh
> /opt/slimserver/platforms/debian/slimserver_safe
> /opt/slimserver/slimserver.pl --prefsfile
> /etc/slimserver/slimserver.pref --logfile
> /var/log/slimserver/slimserver.log --cachedir /var/tmp/slimserver/
> slimser 29667 0.0 33.9 39620 37424 ? S 14:05 0:07
> /usr/bin/perl -w /opt/slimserver/slimserver.pl --prefsfile
> /etc/slimserver/slimserver.pref --logfile
> /var/log/slimserver/slimserver.log --cachedir /var/tmp/slimserver/
> slimser 29669 0.0 0.4 1572 536 ? Ss 14:05 0:00
> /opt/SlimServer_v2005-10-24/Bin/i386-linux/mDNSResponderPosix -d -f
> /var/tmp/slimserver/mDNS.conf -P /var/tmp/slimserver/mDNS.pid
> root 29680 0.0 0.4 1552 476 pts/2 R+ 14:08 0:00 grep
> slim
>
> And /etc/slimserver is as such:
>
> datacube:/opt# ls -ld /etc/slimserver/
> drwxr-xr-x 2 slimserver root 4096 Oct 24 14:01 /etc/slimserver/
>
> Further, as demonstrated above, I can su to the slimserver user
> (forcing its shell to be /bin/bash) and create and write files in
> that
> directory just fine.
>
> Any insight would be appreciated.


At a guess...
user slimserver does not have access to file
/etc/slimserver/slimserver.pref
What does
ls -l /etc/slimserver/slimserver.pref
show?

--
'ooroo

stinga...(:)-)
---------------------------------------------------
Email: stinga (AT) wolf-rock (DOT) com o
You need only two tools. o /////
A hammer and duct tape. If it /@ `\ /) ~
doesn't move and it should, > (O) X< ~ Fish!!
use the hammer. If it moves and `\___/' \) ~
shouldn't, use the tape. \\\
---------------------------------------------------

neurophyre
2005-10-24, 11:30
At a guess...
user slimserver does not have access to file
/etc/slimserver/slimserver.pref
What does
ls -l /etc/slimserver/slimserver.pref
show?


It doesn't exist.

I did

touch /etc/slimserver/slimserver.pref
chown slimserver.nogroup /etc/slimserver/slimserver.pref

and it's no longer complaining with the "2005-10-24 14:16:39.2137 Cannot write to preferences file /etc/slimserver/slimserver.pref, any changes made will not be preserved for the next startup of the server" message.

VERY odd. It seems to think that it can't create the file, but once it's there, it doesn't complain. I'm going to change some settings and see if it retains them properly.

Mattias Holmlund
2005-10-24, 11:32
A quick look at the source finds the following at Slim/Utils/Prefs.pm line 982:

$canWrite = (-e prefsFile() && -w prefsFile()) || (-w preferencesPath());

When running with --prefsfile /etc/slimserver/slimserver.pref,
prefsFile() is '/etc/slimserver/slimserver.pref', but
preferencesPath() is '/root'. This means that the code checks to see
if /etc/slimserver/slimserver.pref exists, and if it doesn't exist it
checks to see if it can write to /root, which it can't and thus the
error-message is printed.

I have to run now, but it should be an easy fix for someone who knows
what preferencesPath() is supposed to be.

/Mattias

On 10/12/05, neurophyre <neurophyre.1wspoc (AT) no-mx (DOT) forums.slimdevices.com> wrote:
>
> datacube:~# ls -l /etc/slimserver/slimserver.pref
> ls: /etc/slimserver/slimserver.pref: No such file or directory
> datacube:~# ps -eafw | grep slimserver
> slimser 25081 1 0 Oct07 ? 00:00:00 /bin/sh
> /opt/slimserver/platforms/debian/slimserver_safe
> /opt/slimserver/slimserver.pl --prefsfile
> /etc/slimserver/slimserver.pref --logfile
> /var/log/slimserver/slimserver.log --cachedir /var/tmp/slimserver/
> slimser 25083 25081 0 Oct07 ? 00:31:17 /usr/bin/perl -w
> /opt/slimserver/slimserver.pl --prefsfile
> /etc/slimserver/slimserver.pref --logfile
> /var/log/slimserver/slimserver.log --cachedir /var/tmp/slimserver/
> slimser 25085 1 0 Oct07 ? 00:00:00
> /opt/SlimServer_v6.1.1/Bin/i386-linux/mDNSResponderPosix -d -f
> /var/tmp/slimserver/mDNS.conf -P /var/tmp/slimserver/mDNS.pid
> root 26262 26256 0 11:34 pts/0 00:00:00 grep slimserver
> datacube:~#
>
>
> --
> neurophyre
>

neurophyre
2005-10-24, 11:53
Maybe somebody should put a pointer to this in the devs board?

A workaround in your platforms-debian file would be to include instructions to touch/chown the slimserver.pref file in /etc/slimserver, for now.

Mattias Holmlund
2005-10-24, 13:04
On 10/24/05, neurophyre <neurophyre.1xf6xn (AT) no-mx (DOT) forums.slimdevices.com> wrote:
>
> Maybe somebody should put a pointer to this in the devs board?
>

I have filed this as bug 2354.

> A workaround in your platforms-debian file would be to include
> instructions to touch/chown the slimserver.pref file in
> /etc/slimserver, for now.

I prefer to wait for a fix for slimserver.

/Mattias