Bug 4611 - Add a "Set to Defaults" button to Server Settings
: Add a "Set to Defaults" button to Server Settings
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Web Interface
: 7.4.0
: All All
: P2 normal with 1 vote (vote)
: 7.4.0
Assigned To: Michael Herger
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-12-21 11:04 UTC by Dan Evans
Modified: 2009-10-05 14:35 UTC (History)
4 users (show)

See Also:
Category: ---


Attachments
cleanup script (1.59 KB, text/plain)
2008-10-10 03:39 UTC, Michael Herger
Details
cleanup executable for Windows (4.58 MB, application/octet-stream)
2008-10-15 06:54 UTC, Michael Herger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Evans 2006-12-21 11:04:56 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?
Comment 1 James Richardson 2008-09-08 12:20:37 UTC
We currently have a "factory reset" per play in SC 7.2.

Dan is asking to add remove cache to this
Comment 2 Michael Herger 2008-09-23 03:58:39 UTC
Should this really be a full wipe, including stuff like music directory, music sources to be used, SN credentials etc.?
Comment 3 Dan Evans 2008-09-23 11:57:40 UTC
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?
Comment 4 Michael Herger 2008-10-08 03:21:07 UTC
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.
Comment 5 Dan Evans 2008-10-09 09:57:27 UTC
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?
Comment 6 Michael Herger 2008-10-10 02:50:58 UTC
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 ;-).
Comment 7 Michael Herger 2008-10-10 03:39:58 UTC
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.
Comment 8 Michael Herger 2008-10-10 08:46:12 UTC
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
Comment 9 Mark Miksis 2008-10-10 11:50:05 UTC
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...
Comment 10 Michael Herger 2008-10-10 22:12:13 UTC
> 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!
Comment 11 Michael Herger 2008-10-13 04:56:24 UTC
change 23532 - more granularity:

--prefs
--logs
--mysql
--filecache

--cache - full cache folder
--all - all of the above
Comment 12 Mark Miksis 2008-10-13 05:28:39 UTC
Change 23534 (7.3/trunk) adds the script to the Deb and RPM builds as /usr/bin/squeezecenter-cleanup.
Comment 13 Mark Miksis 2008-10-14 09:45:14 UTC
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.
Comment 14 Matt Wise 2008-10-14 09:51:03 UTC
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? 
Comment 15 Mark Miksis 2008-10-14 09:57:04 UTC
(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...
Comment 16 Michael Herger 2008-10-15 06:54:53 UTC
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.
Comment 17 Michael Herger 2008-10-15 22:35:10 UTC
Oops... the executable needs to be dropped into SC's server folder as it's using the common strings.txt file.
Comment 18 Michael Herger 2008-10-17 07:22:09 UTC
change 23613 - add cleanup tool to Windows' Start menu. 

Dan - where should this go on Windows and OSX?
Comment 19 Dan Evans 2008-10-22 15:29:38 UTC
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?)
Comment 20 Michael Herger 2008-10-23 00:11:06 UTC
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.
Comment 21 Michael Herger 2008-10-23 00:11:38 UTC
Oops... accidentally changed the assignment.
Comment 22 Michael Herger 2008-10-31 00:11:49 UTC
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).
Comment 23 Dan Evans 2008-11-18 11:19:02 UTC
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.


Comment 24 Michael Herger 2008-11-18 23:06:51 UTC
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...
Comment 25 James Richardson 2008-11-21 09:06:54 UTC
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"
Comment 26 Michael Herger 2008-11-21 09:22:05 UTC
No bug - work in progress. We're expecting translations for next week.
Comment 27 Dan Evans 2008-11-26 10:52:34 UTC
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?
Comment 28 Michael Herger 2008-11-27 02:33:24 UTC
I'd rather have added a button to the preference pane.
Comment 29 Dan Evans 2008-12-01 10:12:15 UTC
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?
Comment 30 Michael Herger 2009-02-13 06:36:39 UTC
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.
Comment 31 Michael Herger 2009-02-24 07:21:14 UTC
change 25148 - To start with I've added a "SqueezeCenter Cleanup" icon to OSX' Application folder (7.4 only).
Comment 32 Dan Evans 2009-03-03 16:50:26 UTC
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.
Comment 33 Michael Herger 2009-03-03 23:45:34 UTC
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.
Comment 34 Michael Herger 2009-04-08 05:28:24 UTC
This should be covered by newly introduced control panel (Windows) and the enhanced PrefPane (OSX)
Comment 35 James Richardson 2009-10-05 14:35:10 UTC
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.