Running as service does not work

For help and support with Universal Media Server
Forum rules
Please make sure you follow the Problem Reporting Guidelines before posting if you want a reply
Post Reply
cjacs
Posts: 1
Joined: Tue Dec 12, 2017 5:54 am

Running as service does not work

Post by cjacs »

Hi

I have installed UMS on my windows 2012 server and it is working fine as a desktop application, and I have setup shares etc.

I then choose the option in the configuration to run as a service. I check in windows services that it is installed, and all ok, it is set yo automatic. I Reboot the server and it is running fine but from external devices, I cant see the server available. (as I do when running as a desktop app) If I then uninstall completely and reinstall as a desktop application all is ok again.

Do I need to do anything else to get it running as a service. I have the latest version installed


Thanks
Nadahar
Posts: 1990
Joined: Tue Jun 09, 2015 5:57 pm

Re: Running as service does not work

Post by Nadahar »

Running UMS as a service works, but it isn't exactly elegant. I don't think this is explained in the documentation, but there are some issues when running UMS as a service for several reasons:

1) A service has no UI. That means that there's no way to see UMS' GUI for the service, so it must be configured using configuration files.
2) UMS defaults to using "%ALLUSERSPROFILE%\UMS" as the profile folder (the folder where configuration files are read and stored). If the user under which the service is running doesn't have read and write permissions to this folder, there will be problems.
3) Java installs firewall rules in Windows firewall that allows incoming traffic to all Java applications by default. As most people have no idea how to configure their firewall, this is what usually allows devices to connect to UMS. When UMS is running as a service, it's running using a "service wrapper" which in another executable and isn't matched by the default Java rules. That means the you have to allow incoming access in the firewall to the service wrapper (the .exe which is registered with the service) manually.
4) UMS will by default listen to TCP ports 5001 and 9001 (in addition to the UPnP ports). Those can only be allocated by one process, so the first one to start "gets" them. That means if the service is started and you attempt to start the desktop application, there will be problems with the sockets. To start UMS as an application, the service must first be stopped and vice versa.
5) UMS isn't written to share the configuration and log files, so when running both the service and the desktop application using the same profile folder, there will be all kind of problems with file access, overwriting each other's files etc. In short, two instances can't be run at the same time using the same profile folder and/or TCP ports.

If you make sure that the service user has the permissions it needs to access the profile folder, that the firewall is configured or disabled and that only one is run at the time, it should work. To not having to edit the configuration files manually you can start and configure UMS as an application, and then stop it and start the service using the same profile folder - and the service will run using the configuration you made in the GUI - but take care to not run them simultaneously, or bad things will happen.
Post Reply