# Plugins Never Exit

**URL:** <https://forums.plex.tv/t/plugins-never-exit/2800>\
**Category:** Dev/API Corner\
**Tags:** plugin-dev\
**Created:** [October 29, 2009, 9:41pm UTC](https://forums.plex.tv/t/plugins-never-exit/2800 "2009-10-29T21:41:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![profplump](https://avatars.discourse-cdn.com/v4/letter/p/aca169/32.png) [@profplump](https://forums.plex.tv/u/profplump)\
**Post date:** [October 29, 2009, 9:41pm UTC](https://forums.plex.tv/t/plugins-never-exit/2800/1 "2009-10-29T21:41:10Z")

</div>

I’ve noticed that plugins for Plex Media Server are launched each time the server is launched, but are not killed when it exists. The results in a whole slew of extra processes hanging around – if you open an close the media server 15 times without logging out I get 15 process for each plugin.  
  
  
  
I assume this is not expected behavior. Short of telling the media server to never quit, so that it stays open even when Plex exits, is there any way to avoid all these other processes?  
  
  
  
Alternatively, is there any way I can figure out which set of the plugins the media server is currently using, so I can write a script to periodically kill old copies?  
  
  
  
Example after a couple of clean start/stop cycles:  
  
  
  
wifi-n-10 ~ 1$ ps awx -o pid,comm | grep ‘Plex Media Server’  
  
1069 Plex Media Server   
  
1070 Plex Media Server   
  
1071 Plex Media Server   
  
1072 Plex Media Server   
  
1075 Plex Media Server   
  
1078 Plex Media Server   
  
1079 Plex Media Server   
  
18144 /Users/profplump/Library/Application Support/Plex/Plex Media Server.app/Contents/MacOS/Plex Media Server  
  
18145 Plex Media Server   
  
18146 Plex Media Server   
  
18147 Plex Media Server   
  
18148 Plex Media Server   
  
18149 Plex Media Server   
  
18150 Plex Media Server   
  
18151 Plex Media Server   
  
18152 Plex Media Server   
  
18153 Plex Media Server   
  
18154 Plex Media Server   
  
18155 Plex Media Server   
  
18156 Plex Media Server   
  
18157 Plex Media Server   
  
18158 Plex Media Server

---

<div class="post-metadata">

**Author:** ![sansnipple](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@sansnipple](https://forums.plex.tv/u/sansnipple)\
**Post date:** [October 29, 2009, 10:01pm UTC](https://forums.plex.tv/t/plugins-never-exit/2800/2 "2009-10-29T22:01:11Z")

</div>

yeah, i also sometimes see that pms once in a while leaves a couple dozen python processes running when it quits, not always for me but sometimes, and then these have to be manually killed. i think this likely the result of pms crashing (which it can do a lot) or quitting prematurely, before it can kill off all the plugins. i think it needs to do something on launch to check if any stranded plugin processes are still running and kill them.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [December 20, 2019, 8:32pm UTC](https://forums.plex.tv/t/plugins-never-exit/2800/3 "2019-12-20T20:32:11Z")

</div>

Closed on December 20, 2019, 8:32pm UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
