Skip to content

Instantly share code, notes, and snippets.

@arcusfelis
Last active November 2, 2015 16:21
Show Gist options
  • Save arcusfelis/390622fc1f385d73eefc to your computer and use it in GitHub Desktop.
Save arcusfelis/390622fc1f385d73eefc to your computer and use it in GitHub Desktop.
Kill the listeners!111

TLDR: kill ejabberd_listeners and check its children.

Commands:

supervisor:which_children(ejabberd_listeners).                                       
timer:sleep(500).                                                                    
code:purge(ejabberd_listener).                                                       
code:load_file(ejabberd_listener).                                                   
timer:sleep(500).                                                                    
code:purge(ejabberd_listener).                                                       
code:load_file(ejabberd_listener).                                                   
timer:sleep(500).                                                                    
code:purge(ejabberd_listener).                                                       
code:load_file(ejabberd_listener).                                                   
timer:sleep(500).                                                                    
supervisor:which_children(ejabberd_listeners).                                       

Result:

(ejabberd@ejabberd01-pool1)1> supervisor:which_children(ejabberd_listeners).                                       
[{{5280,{0,0,0,0},tcp},<0.574.0>,worker,[ejabberd_listener]},
 {{5224,{0,0,0,0},tcp},<0.570.0>,worker,[ejabberd_listener]},
 {{5269,{0,0,0,0},tcp},<0.553.0>,worker,[ejabberd_listener]},
 {{5225,{0,0,0,0},tcp},<0.551.0>,worker,[ejabberd_listener]},
 {{5223,{0,0,0,0},tcp},<0.549.0>,worker,[ejabberd_listener]},
 {{5222,{0,0,0,0},tcp},<0.548.0>,worker,[ejabberd_listener]}]
(ejabberd@ejabberd01-pool1)2>                                       
(ejabberd@ejabberd01-pool1)2> timer:sleep(500).                                                                    
ok
(ejabberd@ejabberd01-pool1)3>                                                                    
(ejabberd@ejabberd01-pool1)3> code:purge(ejabberd_listener).                                                       
false
(ejabberd@ejabberd01-pool1)4>                                                       
(ejabberd@ejabberd01-pool1)4> code:load_file(ejabberd_listener).                                                   
{module,ejabberd_listener}
(ejabberd@ejabberd01-pool1)5>                                                   
(ejabberd@ejabberd01-pool1)5> timer:sleep(500).                                                                    
ok
(ejabberd@ejabberd01-pool1)6>                                                                    
(ejabberd@ejabberd01-pool1)6> code:purge(ejabberd_listener).                                                       
true
(ejabberd@ejabberd01-pool1)7>                                                       
(ejabberd@ejabberd01-pool1)7> code:load_file(ejabberd_listener).                                                   
{module,ejabberd_listener}
(ejabberd@ejabberd01-pool1)8>                                                   
(ejabberd@ejabberd01-pool1)8> timer:sleep(500).                                                                    
ok
(ejabberd@ejabberd01-pool1)9>                                                                    
(ejabberd@ejabberd01-pool1)9> code:purge(ejabberd_listener).                                                       
true
(ejabberd@ejabberd01-pool1)10>                                                       
(ejabberd@ejabberd01-pool1)10> code:load_file(ejabberd_listener).                                                   
{module,ejabberd_listener}
(ejabberd@ejabberd01-pool1)11>                                                   
(ejabberd@ejabberd01-pool1)11> timer:sleep(500).                                                                    
ok
(ejabberd@ejabberd01-pool1)12>                                                                    
(ejabberd@ejabberd01-pool1)12> supervisor:which_children(ejabberd_listeners).                                       
[]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment