Bugzilla – Bug 2354
--prefsfile fails if preferences file does not exist
Last modified: 2008-09-15 14:37:04 UTC
If a preferences file is specified with the --prefsfile parameter, slimserver refuses to write to the specified file for the wrong reason. The code in Slim/Utils/Prefs.pm contains the following test: $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 an error-message is printed: Cannot write to preferences file /etc/slimserver/slimserver.pref, any changes made will not be preserved for the next startup of the server The correct check is to see if it can write to /etc/slimserver, but I don't know if preferencesPath() is wrong or if the check -w preferencesPath() is wrong.
Thanks - fixed in change 4895