PDA

View Full Version : SqueezeCenter on windows with custom cache directory ?



erland
2008-05-11, 23:14
Does anyone know if there is something special I need to do to run SqueezeCenter under ActiveState perl with a custom cache directory on Windows ?

I'm starting it as:


perl slimserver.pl --cachedir C:\Servers\SqueezeCenter701\CacheSmall --prefsdir C:\Servers\SqueezeCenter701\PrefsSmall --logdir C:\Servers\SqueezeCenter701\LogsSmall


And it doesn't seem to be able to start the bundled MySQL database, because I get an error like this when starting:


[08-05-12 08:11:20.7343] Slim::Schema::Storage::throw_exception (70) Error: DBIConnection failed: DBI connect('hostname=127.0.0.1;port=9092;database=sli mserver','slimserver',...) failed: Can't connect to MySQL server on '127.0.0.1' (10061) at C:\Servers\SqueezeCenter701\CPAN/DBIx/Class/Storage/DBI.pm line 652

[08-05-12 08:11:20.7505] Slim::Schema::Storage::throw_exception (70) Backtrace:

frame 0: Slim::Utils::Log::logBacktrace (C:/Servers/SqueezeCenter701/Slim/Schema/Storage.pm line 70)

frame 1: Slim::Schema::Storage::throw_exception (C:\Servers\SqueezeCenter701\CPAN/DBIx/Class/Storage/DBI.pm line 658)

frame 2: DBIx::Class::Storage::DBI::_connect (C:\Servers\SqueezeCenter701\CPAN/DBIx/Class/Storage/DBI.pm line 616)

frame 3: DBIx::Class::Storage::DBI::_populate_dbh (C:\Servers\SqueezeCenter701\CPAN/DBIx/Class/Storage/DBI.pm line 543)

frame 4: DBIx::Class::Storage::DBI::ensure_connected (C:/Servers/SqueezeCenter701/Slim/Schema/Storage.pm line 29)

frame 5: (eval) (C:/Servers/SqueezeCenter701/Slim/Schema/Storage.pm line 29)

frame 6: Slim::Schema::Storage::dbh (C:/Servers/SqueezeCenter701/Slim/Schema.pm line 121)

frame 7: Slim::Schema::init (C:/Servers/SqueezeCenter701/Slim/Music/Info.pm line 76)

frame 8: Slim::Music::Info::init (slimserver.pl line 348)

frame 9: main::init (slimserver.pl line 451)

frame 10: main::main (slimserver.pl line 1012)



[08-05-12 08:11:20.7596] Slim::Schema::init (124) Error: Couldn't connect to database! Fatal error: [] Exiting!

[08-05-12 08:11:20.7613] Slim::Schema::init (124) Backtrace:

frame 0: Slim::Utils::Log::logBacktrace (C:/Servers/SqueezeCenter701/Slim/Schema.pm line 124)

frame 1: Slim::Schema::init (C:/Servers/SqueezeCenter701/Slim/Music/Info.pm line 76)

frame 2: Slim::Music::Info::init (slimserver.pl line 348)

frame 3: main::init (slimserver.pl line 451)

frame 4: main::main (slimserver.pl line 1012)



[08-05-12 08:11:20.7663] Slim::Schema::forceCommit (1368) Warning: Trying to commit transactions before DB is initialized!


Is there something more I need to do to get this to work ?
I want to run it with custom prefs and cache directory to be able to easily switch between different configurations and versions.

JJZolx
2008-05-12, 00:00
Does anyone know if there is something special I need to do to run SqueezeCenter under ActiveState perl with a custom cache directory on Windows ?

I'm starting it as:


perl slimserver.pl --cachedir C:\Servers\SqueezeCenter701\CacheSmall --prefsdir C:\Servers\SqueezeCenter701\PrefsSmall --logdir C:\Servers\SqueezeCenter701\LogsSmall


That's pretty much all there is to it. Unfortunately there's no debugging of command line options, so you'll have to figure out on your own which options the server actually sees. It's easy to tell whether the the cache and log directories are being set correctly just by emptying them out before starting the server and seeing if files are written there. The prefs directory you can tell by the mtime on the server.prefs file, as it gets written regularly.

For testing, what I do is give the server multiple IP addresses and then run several different SlimServers and SqueezeCenters at the same time. I have 6.5.5, 7.0.1 (x 3), 7.1, 7.2 using Perl, plus the installed EXE of 7.0.1 all running at the moment. I let the EXE version use the bundled MySQL but the rest use a seperate installation of MySQL, each with its own database (specified in the prefs file for each).

JJZolx
2008-05-12, 00:05
And it doesn't seem to be able to start the bundled MySQL database, because I get an error like this when starting:

Probably unrelated to directory options. If the bundled MySQL was installed as a service (as, I believe, the Windows installer does) then you can just start the MySQL service before hand. Or run your own MySQL and change the IP address and port number in the server.prefs file as necessary.

erland
2008-05-12, 09:56
That's pretty much all there is to it. Unfortunately there's no debugging of command line options, so you'll have to figure out on your own which options the server actually sees. It's easy to tell whether the the cache and log directories are being set correctly just by emptying them out before starting the server and seeing if files are written there. The prefs directory you can tell by the mtime on the server.prefs file, as it gets written regularly.

All directories are filled after a restart, so the directory parameters works. But I suspect the bundled MySQL instance doesn't find them.


Probably unrelated to directory options. If the bundled MySQL was installed as a service (as, I believe, the Windows installer does) then you can just start the MySQL service before hand. Or run your own MySQL and change the IP address and port number in the server.prefs file as necessary.
I've installed by using SVN without running the Windows installer, so I don't think I have a MySQL service.

erland
2008-05-12, 10:12
It seems like SqueezeCenter always tries to start MySQL as a service on Windows platform, I patched the code a bit and now it works.

Is there no way to configure if it should launch MySQL as a service or not on Windows ?

JJZolx
2008-05-12, 11:57
It seems like SqueezeCenter always tries to start MySQL as a service on Windows platform, I patched the code a bit and now it works.

Is there no way to configure if it should launch MySQL as a service or not on Windows ?

I'm pretty certain that it did this correctly at one time, but the ability to launch the non-service may have been lost at some point since the 7.0 installer.