When I try to stop the plex service, it (rc.d) hangs indefinitely waiting for Plex Tuner Service to close. PTS is unresponsive to kill, and I have to kill -9 it to shut it down.
Version
I’m running plexmediaserver-1.5.7.4016 on FreeBSD-10.3-p19. I’m seeing the same behaviour on all 4 of my servers so hopefully this is easy to reproduce, but if not let me know and I’ll try out different combinations!
By the way, I’ve been seeing it for a few versions of Plex now. I think it’s been happening ever since Plex Tuner Service was introduced, but I’m not certain.
Steps to reproduce
When plex is started, run:
sudo service plexmediaserver stop
Check there are no plex processes left running, e.g. ps aux | grep -i plex
Expected
Plex shuts down and no plex processes are running.
Actual
The service command hangs indefinitely waiting for plex processes to shut down:
$ sudo service plexmediaserver stop
Stopping plexmediaserver.
Waiting for PIDS: 5892.
Cleaning up leftover child processes.
Waiting for PIDS: 5918 5917 5916 5896
If I kill it and check for processes, I see the Plex Tuner Service:
$ ps aux | grep -i plex | less
plex 5917 0.0 0.1 90552 6560 - I Sun12AM 0:06.31 /usr/local/share/plexmediaserver/Plex Tuner Service /usr/local/share/plexmediaserver/Resources/Tuner/Private /usr/local/share/plexmediaserver/Resources/Tuner/Shared 1.5.7.4016-25d94bad9 32600 /waitmutex
sudo kill 5917 doesn’t help, it goes away with sudo kill -9 5917
I have had this same issue ever since the Tuner service was added. I wish there was a way to completely disable the service as I do not have a tuner nor do I plan on buying one anytime soon.
This isn’t quite the same as disabling it, although I suppose that would probably also fix that problem. The process appears to be completely locked up, as it won’t respond to a polite request to quit, so presumably it wouldn’t work for people who do want it on this system configuration either?
I have the exact same issue. I created a script to check for a new version of plex. If a new version is available and no one is streaming from plex, the script goes ahead and download the new version and shutdown plex before updating to the new version and starting plex again. Sadly every time its stuck trying to shutdown the tuner service and I have to connect to the server an kill it with kill -9.
It’s been doing it since introduction of the useless tuner service. I don’t have a tuner, I don’t want the service. I wrote a wrapper script to kill Plex.
#!/usr/local/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/root/bin
ps $(cat /var/run/plex/plex.pid) &>/dev/null || { echo "Plex does not appear to be running";exit; }
echo "Applying the hammer to Plex"
bash -c 'sudo nohup /usr/local/etc/rc.d/plexmediaserver_plexpass stop &>/dev/null &'
sleep 5
sudo pkill -9 -f .*Tuner.*
@zofrex said:
This isn’t quite the same as disabling it, although I suppose that would probably also fix that problem. The process appears to be completely locked up, as it won’t respond to a polite request to quit, so presumably it wouldn’t work for people who do want it on this system configuration either?
Until today, I was in the situation of not using the tuner so didn’t worry about having to kill a few process every one in a while but, now I can confirm that it does lock up the tuner.
Version 1.9.2.4285
Thanks to the OP for saving me the trouble to writing this up as I would love to actually get the tuner fixed now that I have paid the $s to the Plexpass and a tuner… any news or hopes on this front?
Does anyone have the Tuner working in FreeBSD? I am currently on 10.3.
This is still an issue with 1.15.1.707_1, alongside PMS not pulling metadata anymore and the server settings being unavailable, seems like 1.15 is severely broken on freebsd.
About the can’t stop properly issue (needs a kill -9 on the children) this was raised internally a while ago actually, but if I’m being honest it as been low priority, and so not fixed yet.
The workaround is as suggest above to update the rc.d script to send a kill -9 for the children processes.
thanks for your answer, but this does not necessarily resolve the issue.
I had to remove the port and manually remove the plexmediaserver-plexpass directory to get the 1.15.x versions to behave properly.