Bug 4253 - Option --prefdir doesn't work when run as service
: Option --prefdir doesn't work when run as service
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Windows Service
: 7.0
: PC Windows XP
: P2 normal (vote)
: Future
Assigned To: Unassigned bug - please assign me!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-09-28 13:30 UTC by Jim McAtee
Modified: 2008-12-15 13:07 UTC (History)
0 users

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jim McAtee 2006-09-28 13:30:34 UTC
When I designate a prefs file for the SlimServer service by using --prefsfile "<filepath>" SlimServer fails to start, with nothing recorded in its logs and nothing shown in the Windows Event logs.  However, the --prefsfile option works as expected when SlimServer is run from the command line.

I'm running the Perl code using ActiveState Perl, not the compiled EXE.  I don't have the EXE on my system, so I can't test whether its behavior is any different.
Comment 1 KDF 2006-09-28 19:21:52 UTC
how are you starting the service without the exe?
Comment 2 Jim McAtee 2006-09-29 01:13:43 UTC
Using srvany.exe that launches perl.exe that runs slimserver.pl.  Roundabout, but it's pretty much the only way to run the Perl code as a service on Windows.  Not so different, really than running the Perl code as daemon on a *nix system.  I'm looking into whether this is also a bug when running the Windows exe.
Comment 3 Chris Owens 2006-10-25 13:49:22 UTC
The good news is running the .exe as a service with the --prefsfile option doesn't seem to crash.  The bad news is, it also doesn't seem to work for me.  I can enter parameters in the 'start parameters' box, but they don't seem to persist if I close and reopen the service properties pane.  This could be something I am misunderstanding about windows, of course.

Jim, what happens if you run the srvany service from the "services" applet in the "admnistrative tools" area of the control panel?
Comment 4 Jim McAtee 2006-10-26 17:24:56 UTC
Yesterday I installed the 6.5.1 EXE (10/25 build) and tried running it as a service using --prefsfile.  I get the same results, so it appears to behave the same for both the EXE and Perl versions.  The service starts up and then immediately shuts down.  Hard to say why it crashes, but it obviously isn't finding the prefs file switch, as I can see that it starts up the bundled MySQL server which is overridden in the prefs.

But I can run it from the command line with the --prefsfile option.  Doing this, I have three SlimServers running on my system right now.  Just that they can't be run as services due to this bug.  Here's a typical command.  In the registry, this would go under the ImagePath string value for the service entry.  (Broken up onto multiple lines to make reading easier)

"C:\Program Files\SlimServer for Windows\server\slim.exe"
 --playeraddr 192.168.9.4
 --cliaddr 192.168.9.4
 --streamaddr 192.168.9.4
 --httpaddr 192.168.9.4
 --httpport 80
 --noupnp
 --cachedir D:\slim\dot4\Cache
 --logfile D:\slim\dot4\server.log
 --prefsfile D:\slim\dot4\slimserver.pref
Comment 5 Jim McAtee 2007-05-07 13:09:40 UTC
FWIW, I see the identical behavior in 7.0 with the new --prefsdir option.  It works when launched from the command line, but the server fails to start when run as a service.  Again, with nothing logged.
Comment 6 Chris Owens 2007-10-22 09:44:31 UTC
Support is not so good for running multiple services at the same time.  We'll have a look at this down the road.
Comment 7 Jim McAtee 2007-10-22 10:25:05 UTC
It's not a matter of multiple services.  It just plain doesn't work as advertised, even when a single service is run (see comment #4).
Comment 8 Chris Owens 2007-10-23 09:20:44 UTC
This option doesn't exist any more.
Comment 9 Jim McAtee 2007-10-23 09:54:38 UTC
In v7 it's now --prefsdir, which suffers from the same problem.  See:

http://forums.slimdevices.com/showpost.php?p=199718&postcount=14
Comment 10 Michael Herger 2007-11-02 00:55:36 UTC
Change 14312 - please give tonight's build a try.
Comment 11 Jim McAtee 2007-11-02 18:38:32 UTC
Thanks, it appears to be fixed.
Comment 12 James Richardson 2008-12-15 13:07:39 UTC
This bug appears to have been fixed in the latest release!

If you are still experiencing this problem, feel free to reopen the bug with your new comments and we'll have another look.

Make sure to include the version number of the software you are seeing the error with.