PDA

View Full Version : [Slim-Checkins] r6862 -/trunk/server/Slim/Utils/Prefs.pm



Triode
2006-04-09, 13:36
Robert,

I'm finding this cause me problems and wondered if this is going to be a common case..

I originally installed from rpm and hence my prefs file is in /etc. Using atomic means the server attempts to write a new file with
the pid appended to the name. This fails as the default permissions don't let the server write new files in /etc:

write_file '/etc/slimserver.conf.26463' - sysopen: Permission denied at /usr/local/slimserver/Slim/Utils/Prefs.pm line 949

Clearly I can fix my permissons or move the prefs file, but is this going to cause problems for other linux rpm users?

Adrian

> Author: grotus
> Date: Sat Apr 8 15:50:26 2006
> New Revision: 6862
>
> URL: http://svn.slimdevices.com?rev=6862&view=rev
> Log:
> Bug: 688
> Bug: 2009
> Description:
> Write out prefs atomically using File::Slurp::write_file.
>
> Modified:
> trunk/server/Slim/Utils/Prefs.pm
>

Grotus
2006-04-09, 16:54
I think that we will want to write atomicly, to avoid the cases where we
currently end up with a blank preferences file. At the same time,
crashing because we can't write atomic isn't very good behavior.
Probably we need to put in a -w check on the parent directory of the
prefsFile() and only write in an atomic manner if we pass that -w check.

I'll stick something in there later tonight, I'm just about to leave the
house.

Triode blurted out:
> Robert,
>
> I'm finding this cause me problems and wondered if this is going to be a
> common case..
>
> I originally installed from rpm and hence my prefs file is in /etc.
> Using atomic means the server attempts to write a new file with
> the pid appended to the name. This fails as the default permissions
> don't let the server write new files in /etc:
>
> write_file '/etc/slimserver.conf.26463' - sysopen: Permission denied at
> /usr/local/slimserver/Slim/Utils/Prefs.pm line 949
>
> Clearly I can fix my permissons or move the prefs file, but is this
> going to cause problems for other linux rpm users?
>
> Adrian
>
>> Author: grotus
>> Date: Sat Apr 8 15:50:26 2006
>> New Revision: 6862
>>
>> URL: http://svn.slimdevices.com?rev=6862&view=rev
>> Log:
>> Bug: 688
>> Bug: 2009
>> Description:
>> Write out prefs atomically using File::Slurp::write_file.
>>
>> Modified:
>> trunk/server/Slim/Utils/Prefs.pm
>>
>
>

Mark Miksis
2006-04-10, 10:05
...but is this going to cause problems for other linux rpm users?
FWIW, yes. It bit me.