Bugzilla – Bug 4611
Add a "Set to Defaults" button to Server Settings
Last modified: 2009-10-05 14:35:10 UTC
There are many times when Support needs the customer to revert their Slimserver to default settings and walk them through set up from scratch. Currently we direct them to delete the slimserver.pref file which can be very difficult for some customers not saavy with file manipulation. Can we add a button in Server Settings somewhere which would wipe the contents of the slimserver.pref and rebuild the default file?
We currently have a "factory reset" per play in SC 7.2. Dan is asking to add remove cache to this
Should this really be a full wipe, including stuff like music directory, music sources to be used, SN credentials etc.?
This enhancement is intended to bring SqueezeCenter back to its default installed state-- akin to if we deleted the Prefs and Cache folders. Maybe it should be expanded to offer either a "partial" wipe and a "full" wipe? "Partial" Wipe... delete: * Cache folder including full Library/MySQL db "Full" Wipe... delete: * Cache folder, including full Libary/MySQL db * Prefs folder, including server.prefs * Any OPML files saved to current Playlists folder (favorites.opml, etc.) Don't know if that 2x the work or the same since you're adding the function already. James or Steven-- would you add anything to the above lists for the "partial" or "full" wipes?
I'm not sure this can reliably done from within SC. There's too much initialisation involved (DB, settings etc.) which usually is done at startup time only. I'd rather see this as a feature from within the tray icon or control panel.
I understand your dilemma, and if this was only for Windows / Mac users I think that'd be fine. But... We need this functionality to be within SC for cases where SC is running on a NAS, where there is no tray icon or control panel to speak of. Should we split this bug into 2? One for Windows/Mac and another for NAS builds?
I see your point. But the more I think about this the less I'd want to do it in SC. We have various sub-systems which need to be stopped and re-initialised: prefs, database, templating, artwork cache, strings, fonts... Doing this while SC is running seems like a lot of hassle, work and runtime overhead for a rarely used "feature". Plus imho it's so prone to errors and side-effects that most users would end up re-starting SC afterwards anyway. Compared to this running the cleanup outside SN is as simple as deleting one or two folders. We should come up with a script which does the job automatically. This script could then easily be launched from the tray icon, control panel or the NAS' web UI. As for the NAS case: if we had that script, NAS manufacturers or contributors which offer NAS integration for SC could easily integrate that script into the device's web UI. NAS which only offer shell access would be fine, too. And at some point we have to stop support people who use devices which neither have a shell nor a web UI to manage the device ;-).
Created attachment 4125 [details] cleanup script I'd bet an SC integrated solution would require 10x the code to do the job less efficiently ;-) This script uses the same code as SC to determine where our files and folders are stored. Just give it a try - it won't delete anything. The most important line ("rmtree ...") is commented out.
Ok, I've added a slightly improved version of the script to the repository. We might want to add it to the list of executables to be included with the nightly builds. But for now, please test on various platforms. change 23516
Michael, I'm not sure how much time you want to spend on this, but it might to nice to add more granularity to cleaning the cache dir, such as "only delete the mysql tables", etc. Note that there are still cases where SC will write opml files to the cachedir if the playlistdir is not writable, so doing "cleanup.pl --cache" can cause a loss of user data. BTW, I can add this to the RPM and deb if you want...
> I'm not sure how much time you want to spend on this, but it might to nice to > add more granularity to cleaning the cache dir Good comment. Will be easy to add. > BTW, I can add this to the RPM and deb if you want... that would be great!
change 23532 - more granularity: --prefs --logs --mysql --filecache --cache - full cache folder --all - all of the above
Change 23534 (7.3/trunk) adds the script to the Deb and RPM builds as /usr/bin/squeezecenter-cleanup.
Hey Matt, regarding change 23562, I actually intended to put the cleanup script in /usr/bin but I probably broke the deb because I didn't add /usr/bin to the dirs file. Sorry about that :-( If you think it more properly belongs in /usr/sbin, let me know and I'll change the RPM to match the deb.
Fletch, ah ... well the only reason I thought that sbin made sense was that the other files were there as well. Is there a reason to split them up?
(In reply to comment #14) > Fletch, ah ... well the only reason I thought that sbin made sense was that the > other files were there as well. Is there a reason to split them up? > It's just an esoteric FHS question. /usr/sbin is for system administration and root-only commands. The user may also run the cleanup script as the squeezecenter user. The more I think about it, /usr/sbin is probably better, but I don't feel that strongly either way. I just want to make sure that the RPM and deb are the same to avoid further confusion...
Created attachment 4137 [details] cleanup executable for Windows James/Dan - this is a Windows binary of the cleanup executable file. It should allow you to use the GUI. Please give it a try. On other systems the script should show the GUI if wxPerl is installed (which imho is the case for OSX). If wxPerl is not available, the script will still work in console mode ("cleanup.pl --prefs --cache"). Matt - could you please install wxPerl on winbuild? http://prdownloads.sourceforge.net/wxperl/Wx-0.26-wxmsw2.6.2-win32-u-5.8.6.zip - seems to be pretty old, but working.
Oops... the executable needs to be dropped into SC's server folder as it's using the common strings.txt file.
change 23613 - add cleanup tool to Windows' Start menu. Dan - where should this go on Windows and OSX?
Michael-- In Windows, I agree that the Start menu is likely the best place for this tool, which is where it is now it appears. In Mac OS, can we place this somehow in the PrefPane? Not sure where, or how. Perhaps an "Advanced" button that brings up your script & GUI? If not the PrefPane, maybe we need a folder in Applications and we could place it there? (slightly off-topic, i've always wondered why we don't install our server application in the Application folder?)
Dan - I'm very likely going to do some work on the OSX pref pane and installer. I'll see what I can do. This will be the first Objective C code I'll do. Pref pane vs. application: SC isn't an application like word. It's a server app or service (don't tell the customer - might be scary :-)). The pref pane is basically an additional item to control that service. I mean you don't go to the apps to start SC, as you want it to be running in the background, even when logged out.
Oops... accidentally changed the assignment.
I'm sorry Dan, the OSX installer rework has been punted to 8.0. There won't be an easily accessible button in 7.3/OSX. But the cleanup.pl script is there to be used from the command line ("wxPerl cleanup.pl" if you want the gui, "cleanup.pl" for command line mode only).
Michael-- The Windows cleanup applet works like a charm. Thank you! Regarding the Mac version, cleanup.pl, is there a way we can install an alias that runs "wxPerl cleanup.pl", and make that alias available in an easy to access folder? (like Application Support/SqueezeCenter) As it is, I can't imagine using it with a customer. It was just an icon the customer could click though, then we could use it.
Dan - I wanted to add it to the prefpane when we're refreshing it. But this won't happen for 7.3. I wouldn't even know where to put that alias...
Michael: I noticed that on Windows, the Program File for this has not been translated into the supported languages. Should that be a separate bug? I.E. Windows XP > Start > All Program > SqueezeCenter > "Reset configuration to defaults"
No bug - work in progress. We're expecting translations for next week.
Michael-- I'd like to continue discussing how and where we could include some kind of icon a user could double-click to open your new Cleanup GUI. I propose: * Add an icon in /Users/<user>/Application Support/SqueezeCenter * Call the icon "Cleanup Tool" or "Configuration Cleanup" * The icon is an alias or applescript that runs "wxPerl cleanup.pl" What do you think?
I'd rather have added a button to the preference pane.
I agree with you 100%. However, given that we have to wait until 8.0 for a PrefPane button, is the above suggestion doable in the meantime?
Added buttons/menu items to launch the cleanup tool to the new WHS add-in and the SqueezeTray for Windows. Still to do on OSX.
change 25148 - To start with I've added a "SqueezeCenter Cleanup" icon to OSX' Application folder (7.4 only).
Michael-- fantastic! great to see this in OSX now too. One thing I noticed: running the script appears to fail if SC is running. The error, "please run this only after stopping SC" appears behind the Finder window so is invisible.
Yeah, there's still a focus problem on OSX. I'll probably have the dialog a bit larger and add a status bar with feedback. And I'll disable the button as long as SC is running. I've spent some time working on it recently, and it looks a bit different already in 7.4.
This should be covered by newly introduced control panel (Windows) and the enhanced PrefPane (OSX)
This bug has been marked as fixed in the 7.4.0 release version of SqueezeBox Server! * SqueezeCenter: 28672 * Squeezebox 2 and 3: 130 * Transporter: 80 * Receiver: 65 * Boom: 50 * Controller: 7790 * Radio: 7790 Please see the Release Notes for all the details: http://wiki.slimdevices.com/index.php/Release_Notes If you haven't already, please download and install the new version from http://www.logitechsqueezebox.com/support/download-squeezebox-server.html If you are still experiencing this problem, feel free to reopen the bug with your new comments and we'll have another look.