restarting UMS in command prompt

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
Bembudo
Posts: 35
Joined: Sat Feb 13, 2016 6:02 am

restarting UMS in command prompt

Post by Bembudo »

Hello,

Is there a way to restart UMS in command prompt ? I wrote a script that converts all my videos to MP4, I want to be able to restart UMS in a batch file immediately after a file has been converted.
Nadahar
Posts: 1990
Joined: Tue Jun 09, 2015 5:57 pm

Re: restarting UMS in command prompt

Post by Nadahar »

There's no way to do that safely in Windows that I know off. In Linux you can use "kill -15", which should stop UMS normally instead of just terminating it and potentially corrupting the database and/or other files.

You can use taskkill under Windows AFAIK, but it doesn't shut it down gracefully. If you're using Windows I guess you could run UMS as a service, and stop and start it using "net restart", but running UMS as a service has multiple challenges: You don't get a GUI for UMS, and if you start UMS an an application (with GUI) while the service is running you will get problems. Also, running it as a service requires you to manually configure firewall rules if you use Windows firewall.
Bembudo
Posts: 35
Joined: Sat Feb 13, 2016 6:02 am

Re: restarting UMS in command prompt

Post by Bembudo »

Thanks Nadahar, No big deal I thought I would try. I'm just trying to find the laziest way possible :D However I did write the script in Ruby, is there a safe way in Ruby ?
Nadahar
Posts: 1990
Joined: Tue Jun 09, 2015 5:57 pm

Re: restarting UMS in command prompt

Post by Nadahar »

It doesn't depend on the script language, but the OS. If you're on Linux you should be able to find a way to send SIGTERM to the process from any language on Linux.
Post Reply