Bugzilla – Bug 6868
Logs are saved in the wrong place on the Mac.
Last modified: 2008-12-18 11:12:53 UTC
The logs should be saved in the user's ~/Library, not /Library From the forums: On Jan 30, 2008, at 12:36 PM, El Callado wrote: I don't yet have a Squeezebox -- I'm planning to buy the Duet when it comes out -- but I've installed SC7 (revision 16955) on a Mac and played around with it a little. The first thing I noticed was a problem with the script Slim/Utilities/OSDetect.pm. Lines 184-186 are as follows: Code: -------------------- if (-d "/Library/Application Support/SqueezeCenter") { mkpath("/Library/Logs/SqueezeCenter"); -------------------- This causes a permission error if the user who first runs the server is not a member of the admin group. Even if the directory exists and is world-writable (which it shouldn't be), trying to write to log files created by another user won't work. With multiple users able to run SC, each one should have his own logs. So I commented this out. The same goes for lines 194-196, which assume there is a root-level log directory if there is a root-level Application Support directory. Another change that should be made to this file is to add the MacPorts directory '/opt/local/bin' to the binary search path on line 128. -- El Callado ------------------------------------------------------------------------ El Callado's Profile: http://forums.slimdevices.com/member.php?userid=15274 View this thread: http://forums.slimdevices.com/showthread.php?t=42891 _______________________________________________ beta mailing list beta@lists.slimdevices.com http://lists.slimdevices.com/lists/listinfo/beta
Created attachment 2781 [details] fix system wide logging Dean - the idea clearly was to have the log file in the system wide Log folder if SC is installed system wide. This patch checks whether /Library/Log is writable before trying to create the sub folder. Otherwise it will fall back to the user's log folder. Is this ok with you?
If SC was running as root, it would make sense to write to /Library but since the individual user is starting it (though anybody may run it), it should be saved where the user has permissions, namely ~/Library for all its stuff (logs, preferences, cache, etc.) Check out http://developer.apple.com/documentation/MacOSX/Conceptual/BPFileSystem/Articles/Domains.html#//apple_ref/doc/uid/20002281
That's exactly what my patch should. Shall I check it in?
Hm, my thinking was that we wouldn't do anything in /Library on the mac at all, since we're not running as root.
(In reply to comment #4) > Hm, my thinking was that we wouldn't do anything in /Library on the mac at all, > since we're not running as root. I'm the poster of the forum message. I agree that SC shouldn't try to write anything at all outside the user's home directory. /Library/Logs is writable only by root. /Library/Caches is writable only by the admin group. You could use the installer to create directories here, but then files created by one user wouldn't be writable by another. Writing to a single cache and log would be fine if SC always ran in a dedicated account, like a mail server, and different users could log in to it. But that's not how it works.
change 17074 - don't touch the system wide log folder at all.
This bug is being closed since it was resolved for a version which is now released! Please download the new version of SqueezeCenter (formerly SlimServer) at http://www.slimdevices.com/su_downloads.html If you are still seeing this bug, please re-open it and we will consider it for a future release.