You need to modify your shutdown procedure to kill the external scripts as
well.
For a hack you can simply add something like this to the end of your
shutdown script:

pkill -u prosody

(Assuming your running server as prosody user).

It might be easier and better for long term sanity just to write your own
auth module instead of using a separate process script.


On Wed, Feb 24, 2016 at 7:17 AM Rainer Schuth <rainer.sch...@vnc.biz> wrote:

> Hello,
>
> any ideas on this?
>
> I am using  prosody-0.10_1nightly214-1~trusty on a Ubuntu 14.04 64bit.
>
> Thanks,
>
>
> ----- Am 19. Feb 2016 um 10:48 schrieb Rainer Schuth rainer.sch...@vnc.biz
> :
>
> > Hello,
> >
> > since a couple of days I am experiencing a problem when I am restarting
> prosody:
> > prosody basically stops working, because it cannot open the ports it
> needs.
> >
> > From the log:
> >
> > Feb 19 10:09:59 example.com:http warn    Not listening on any ports,
> > 'altconnect' will be unreachable
> > Feb 19 10:09:59 example.com:http warn    Not listening on any ports,
> 'websocket'
> > will be unreachable
> > Feb 19 10:09:59 example.com:http    warn    Not listening on any ports,
> 'bosh'
> > will be unreachable
> >
> > Netstat says that a bash script is listening on the 5222 port O_o
> >
> > netstat -avpntu | grep 5222
> > tcp        0      0 0.0.0.0:5222            0.0.0.0:*
>  LISTEN
> > 17137/bash
> > tcp      161      0 127.0.0.1:5222          127.0.0.1:38753
>  CLOSE_WAIT
> > -
> > tcp      161      0 127.0.0.1:5222          127.0.0.1:38765
>  CLOSE_WAIT
> > -
> > tcp      161      0 127.0.0.1:5222          127.0.0.1:38785
>  CLOSE_WAIT
> > -
> > tcp      161      0 127.0.0.1:5222          127.0.0.1:38782
>  CLOSE_WAIT
> > -
> >
> > Querying ps gives me this:
> >
> > prosody  17137  0.0  0.0  12428  1448 pts/7    Ss+  Feb18   0:00
> /bin/bash
> > /opt/prosody_auth_provider.sh
> > prosody  17139  0.0  0.0  12428  1448 pts/8    Ss+  Feb18   0:00
> /bin/bash
> > /opt/prosody_auth_provider.sh
> > prosody  17141  0.0  0.0  12428  1448 pts/9    Ss+  Feb18   0:00
> /bin/bash
> > /opt/prosody_auth_provider.sh
> > prosody  17143  0.0  0.0  12428  1448 pts/10   Ss+  Feb18   0:00
> /bin/bash
> > /opt/prosody_auth_provider.sh
> > prosody  17151  0.0  0.0  12428  1448 pts/11   Ss+  Feb18   0:00
> /bin/bash
> > /opt/prosody_auth_provider.sh
> > prosody  17154  0.0  0.0  12428  1444 pts/12   Ss+  Feb18   0:00
> /bin/bash
> > /opt/prosody_auth_provider.sh
> > prosody  17157  0.0  0.0  12428  1448 pts/13   Ss+  Feb18   0:00
> /bin/bash
> > /opt/prosody_auth_provider.sh
> > prosody  17159  0.0  0.0  12428  1444 pts/14   Ss+  Feb18   0:00
> /bin/bash
> > /opt/prosody_auth_provider.sh
> > prosody  17164  0.0  0.0  12428  1448 pts/15   Ss+  Feb18   0:00
> /bin/bash
> > /opt/prosody_auth_provider.sh
> > prosody  17168  0.0  0.0  12428  1448 pts/16   Ss+  Feb18   0:00
> /bin/bash
> > /opt/prosody_auth_provider.sh
> >
> >
> > Apparently after restarting the prosody daemon, the lua process is
> killed, but
> > the external authentication scripts remain alive, thus blocking the
> ports used
> > by prosody before being stopped.
> >
> > I am using mod_auth_external.html
> > (https://modules.prosody.im/mod_auth_external.html) for a virtual host.
> I am
> > also using libevent.
> >
> > VirtualHost "example.com"
> >
> >    authentication = "external"
> >    external_auth_command ="/opt/prosody_auth_provider.sh"
> >    external_auth_protocol = "generic"
> >    external_auth_processes = 10
> >
> >
> > The prosody_auth_provider.sh script is basically the same example file
> for the
> > module:
> >
> https://hg.prosody.im/prosody-modules/file/50c188cf0ae3/mod_auth_external/examples/bash/prosody-auth-example.sh
> >
> > So when prosody starts the first time it spawns 10 external auth
> processes. But
> > prosody or the operating system does not kill this child processes before
> > stopping prosody.
> > Thus when the prosody process is killed (SIGTERM) the ports are
> inherited to the
> > external auth scripts (O_o ?), meaning that when a new prosody process
> starts
> > it cannot bind to the ports anymore.
> >
> > Killing the external auth processes and restarting prosody does solve the
> > problem.
> >
> >
> > Any ideas?
> >
> > Kind regards
> >
> > Rainer Schuth
>
>
>
> Kind regards
>
> Rainer Schuth
>
> --
> You received this message because you are subscribed to the Google Groups
> "prosody-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to prosody-dev+unsubscr...@googlegroups.com.
> To post to this group, send email to prosody-dev@googlegroups.com.
> Visit this group at https://groups.google.com/group/prosody-dev.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"prosody-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to prosody-dev+unsubscr...@googlegroups.com.
To post to this group, send email to prosody-dev@googlegroups.com.
Visit this group at https://groups.google.com/group/prosody-dev.
For more options, visit https://groups.google.com/d/optout.

Reply via email to