UMS is not stopping
Forum rules
Please make sure you follow the Problem Reporting Guidelines before posting if you want a reply
Please make sure you follow the Problem Reporting Guidelines before posting if you want a reply
UMS is not stopping
System: AlmaLinux 8
Version: UMS 13.2.0
Java: java-1.8.0-openjdk-1.8.0.362.b09-2.el8_7.x86_64
UMS is started via systemd (systemctl start ums) (see attachment).
When I stop the service (systemctl stop ums) it will always hang for 1m30s and then use SIGKILL to kill the process.
After which I see (systemctl status -l ums)
This means turnning off my media server takes an extra 1m30s, which could be a problem during a blackout.
Anyone have an idea on why UMS doesn't stop when asked politely?
Version: UMS 13.2.0
Java: java-1.8.0-openjdk-1.8.0.362.b09-2.el8_7.x86_64
UMS is started via systemd (systemctl start ums) (see attachment).
When I stop the service (systemctl stop ums) it will always hang for 1m30s and then use SIGKILL to kill the process.
After which I see (systemctl status -l ums)
Code: Select all
� ums.service - Universal Media Server
Loaded: loaded (/etc/systemd/system/ums.service; enabled; vendor preset: disabled)
Active: failed (Result: timeout) since Mon 2023-03-06 15:42:03 EST; 7min ago
Process: 20999 ExecStop=/usr/bin/pkill --signal SIGINT -f java .*ums.jar.* (code=exited, status=0/SUCCESS)
Process: 20354 ExecStart=/opt/ums/startup.sh (code=killed, signal=KILL)
Main PID: 20354 (code=killed, signal=KILL)
Mar 06 15:39:39 henry.localdomain systemd[1]: Started Universal Media Server.
Mar 06 15:40:33 henry.localdomain systemd[1]: Stopping Universal Media Server...
Mar 06 15:42:03 henry.localdomain systemd[1]: ums.service: State 'stop-sigterm' timed out. Killing.
Mar 06 15:42:03 henry.localdomain systemd[1]: ums.service: Killing process 20354 (java) with signal SIGKILL.
Mar 06 15:42:03 henry.localdomain systemd[1]: ums.service: Main process exited, code=killed, status=9/KILL
Mar 06 15:42:03 henry.localdomain systemd[1]: ums.service: Failed with result 'timeout'.
Mar 06 15:42:03 henry.localdomain systemd[1]: Stopped Universal Media Server.
Anyone have an idea on why UMS doesn't stop when asked politely?
- Attachments
-
- ums-shutdown.zip
- (557.64 KiB) Downloaded 371 times
Re: UMS is not stopping
I don't know anything about the shutdown sequence but it has been a problem for a while.
Usually I see errors in logs due to the ports or database still being in use when trace logs are generated because when UMS is restarted as a new process the old one is still shutting down and still using them.
I think a part of that is to make sure everything has fully completed its process to prevent any corruption to the database and to inform everything on the network that it is shutting down. I'm sure this could be optimised better as the library scanner was still working at the end of the logs.
Usually I see errors in logs due to the ports or database still being in use when trace logs are generated because when UMS is restarted as a new process the old one is still shutting down and still using them.
I think a part of that is to make sure everything has fully completed its process to prevent any corruption to the database and to inform everything on the network that it is shutting down. I'm sure this could be optimised better as the library scanner was still working at the end of the logs.
Logs are important for us to help, Please follow This Link before asking for support. Just a forum cleaner, Will help if I can but no expert.
Re: UMS is not stopping
It occurred to me that I am the Programmer Born, so I grabbed the source code from git, recompiled and ran that. Using 13.2.1-SNAPSHOT, UMS shuts down correctly.
The jre17 shipping with 13.2.0 (BellSoft 17.0.5, 2022-10-18) is different from the jre17 I compiled with (BellSoft 17.0.6, 2023-01-17).
Next step, compile 13.2.0 and see if problem returns.
The jre17 shipping with 13.2.0 (BellSoft 17.0.5, 2022-10-18) is different from the jre17 I compiled with (BellSoft 17.0.6, 2023-01-17).
Next step, compile 13.2.0 and see if problem returns.
Re: UMS is not stopping
I run UMS on a headless Gentoo Linux server.
My system java is always kept up to date.
I always modify UMS.sh so UMS uses my system java and not the UMS supplied java.
In UMS.sh change:
# Use our JVM if it exists
if [ -f jre17/bin/java ]; then
JAVA="jre17/bin/java"
fi
To:
# Use our JVM if it exists
#if [ -f jre17/bin/java ]; then
# JAVA="jre17/bin/java"
#fi
My system java is always kept up to date.
I always modify UMS.sh so UMS uses my system java and not the UMS supplied java.
In UMS.sh change:
# Use our JVM if it exists
if [ -f jre17/bin/java ]; then
JAVA="jre17/bin/java"
fi
To:
# Use our JVM if it exists
#if [ -f jre17/bin/java ]; then
# JAVA="jre17/bin/java"
#fi
Re: UMS is not stopping
UMS 13.2.0 compiled with JRE17.0.6+10 shuts down correctly.
UMS 13.2.0 compiled with JRE17.0.5+8 shuts down correctly.
I reinstalled UMS from UMS-13.2.0-x86_64.tgz and now it shuts down correctly.
I tried precompiled UMS using a system java (bellsoft-java17) and it shuts down correctly.
I tried precompiled UMS using a system java (java-19-openjdk-19.0.2.0.7-1.rolling.el8) and it shuts down correctly.
Unfortunately I managed to muck up my initial install of UMS. The one that was causing the problem.
In other words, I'm now unable to reproduce the problem.
UMS 13.2.0 compiled with JRE17.0.5+8 shuts down correctly.
I reinstalled UMS from UMS-13.2.0-x86_64.tgz and now it shuts down correctly.
I tried precompiled UMS using a system java (bellsoft-java17) and it shuts down correctly.
I tried precompiled UMS using a system java (java-19-openjdk-19.0.2.0.7-1.rolling.el8) and it shuts down correctly.
Unfortunately I managed to muck up my initial install of UMS. The one that was causing the problem.
In other words, I'm now unable to reproduce the problem.
Re: UMS is not stopping
A better way to do this is to just move the jre17 directory out of the way :
Code: Select all
cd /dir/you/installed/ums/in
mv jre17 jre17-NOT
Code: Select all
lsof -c java | grep libjavajpeg
Re: UMS is not stopping
I hate it when that happens. You find a problem and go tracking it down until you accidentally fix it and are unable to reproduce

On the plus side it is now working as intended

Logs are important for us to help, Please follow This Link before asking for support. Just a forum cleaner, Will help if I can but no expert.
Re: UMS is not stopping
A better way to do this is to just move the jre17 directory out of the way :
Either way has the same end result.
I prefer to modify UMS.sh to prevent UMS even checking for the UMS java version in the first place.
Either way has the same end result.
I prefer to modify UMS.sh to prevent UMS even checking for the UMS java version in the first place.
Re: UMS is not stopping
The main reason I like to use my system java is because I do any updates on my server once a week.
Java with UMS is V17.0.5 and my system java is V17.0.6.
It's not a big deal but sometimes the java version included with UMS can be quite a bit older.
Java with UMS is V17.0.5 and my system java is V17.0.6.
It's not a big deal but sometimes the java version included with UMS can be quite a bit older.