mstinaff / PMS_Updater

Shell script for updating the Plex Media Server inside the FreeNAS Plex plugin
MIT License
439 stars 91 forks source link

Cannot stop plex service #41

Closed mattgdev69 closed 5 years ago

mattgdev69 commented 5 years ago

Probably not directly related to the script but I cannot stop the Plex service. The script hangs on:

Cleaning up leftover child processes Waiting for PIDS: 39169 39168 39167 39162

The script hangs there and will not continue. I can re-start the service but not update it.

hunsra commented 5 years ago

Same issue here.

Will-i-B commented 5 years ago

Same issue: When trying to update from 1.15.2.993 to 1.16.0.1226, the script hangs waiting for PIDS and I can restart plex pass service but without update.

Download Complete Verifying /tmp/PlexMediaServer-1.16.0.1226-7eb2c8f6f-FreeBSD-amd64.tar.bz2 .....Done Removing previous PMS Backup .....Done. Stopping Plex Media Server .....Stopping plexmediaserver_plexpass. Waiting for PIDS: 77352, 77352. Cleaning up leftover child processes. Waiting for PIDS: 77360 77359 77358 77353

Kill command does not seem to help. Add'l info: I have successfully run the script for prior updates. I have plexpass if that was not already clear. And before starting the manual update process, I updated to the latest FreeNAS OS version and updated all installed packages (ca_root_nss, wget, and perl5). Also tried stopping jails in case the processes were contained in jails. Unsuccessful after many attempts. Still keeps hanging at Waiting for PIDS.

jbeez commented 5 years ago

Try this one I just modified, from freenas not inside of a jail: https://raw.githubusercontent.com/jbeez/PMS_Updater/master/PMS_Updater.sh

edit your jailname up top, and i'd probably change verbose and autoupdate to 1 or feed it on the command line.

mattgdev69 commented 5 years ago

I could not get the updated script to work. Attached is a screenshot. I dropped the script in where the old script was downloaded and ran it from the FreeNAS shell (not the Jail shell).

Screenshot from 2019-07-04 07-00-16

jbeez commented 5 years ago

I did one for inside the jail after this one too. I'm still working on improving this, but the one on my git should do it for you, https://raw.githubusercontent.com/jbeez/PMS_Updater/InjailScript/PMS_Updater.sh

This one uses python that ships with PMS instead of perl for the json decode, so it can run inside with minimal fuss. You still need wget though, I'm working on that now using fetch and cleaning it up a little. Also switching to the token auth api method instead of username/password

mattgdev69 commented 5 years ago

Ok, thank you for working on this. I'm still getting the same result as the first attempt. Did I do something wrong?

Screenshot from 2019-07-04 09-22-26

jbeez commented 5 years ago

I don't think those errors in the middle are important, it is telling you the latest version is already installed. I'm just finishing up this plex token version if you want to try it. You already have plex installed in a jail and theres a Preferences.xml file in /Plex Media Server/ folder right? I'm finishing how it grabs your auth token from preferences file so you wont need to pass u/p anymore.

jbeez commented 5 years ago

Give this a shot, https://raw.githubusercontent.com/jbeez/PMS_Updater/TokenAuth/PMS_Updater.sh

Everything seems to be functioning in my testing. I also have plexpass. It still wouldn't update you though if you're on the latest version. If you updated and didn't restart plexmediaserver_plexpass to load the new files into memory you should do that. There's always the force option as well

mattgdev69 commented 5 years ago

Success! I re-started the service and it worked (without trying again). I didn't really see any confirmation that the install worked or might have just missed it. Thank you again.

Screenshot from 2019-07-04 10-49-57

mattgdev69 commented 5 years ago

I want to confirm that the "Plex Token" Version of this script works like a charm which is the last linked script above. I was able to update to the latest version today without using credentials on the command line. Thanks again!