plexinc / plex-media-player

Next generation Plex Desktop/Embedded Client
GNU General Public License v2.0
1.17k stars 170 forks source link

Kill the helper on shutdown/reboot. #957

Closed gbooker closed 4 years ago

gbooker commented 4 years ago

On linux systems, when the shutdown or reboot is triggered from PMP, the helper can suspend the shutdown/reboot process for 90s (default) while the OS is waiting for it to quit and not doing so. This kills the helper before we get there and thus enabling a much faster shutdown/reboot in those circumstances.

gbooker commented 4 years ago

I'm not sure of the exact circumstances leading to the helper not being quit during a reboot/shutdown but I can tell you it's not consistent.

In my setup I have Ubuntu 18.04 set to auto-login and upon login it'll launch PMP. If I tell it to shutdown or reboot from PMP, sometimes it'll hang during the shutdown process waiting for the pmp helper to exit and if it encounters this, it always times out and kills it outright. This occurs on two separate installs so it's not unique to one. In both cases, the above code change means the shutdown is not impeded. It's a very dramatic difference in that the shutdown speed goes from 93 seconds -> 3 seconds.

mitzsch commented 4 years ago

Does the pmphelper even has a function under Linux? I mean you can compile pmp without pmphelper by adding -DENABLE_HELPER=off to the CMake line and you are good to go. (this is how I do it)