[ejabberd] extauth - does the script need to run continuously?

Belorion belorion at gmail.com
Fri Jul 31 20:19:36 MSD 2009

Thanks, Jesse, for your response.  I missed it at first - I hadn't realized
I was subscribed in digest mode, and didn't notice the email previously.

Thanks for the script example.  I did not realize at first that the
authentication script runs continuously, listening for input on stdin - but
that makes sense.  A fresh execution of an auth script would be exceeding

My fix was simply to do a while(true) loop, listening for input on stdin.
If stdin was closed (or sent a null character, \0), then I broke the loop
and exited the program.  This seems to be working well for me.

And it turns out the CPU spike was because I was *not* detecting a closed
stdin, and so it would try to read from stdin, fail, and then repeat the
loop.  By handling a closed stdin this problem went away.

Thanks again,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.jabber.ru/pipermail/ejabberd/attachments/20090731/a43ab5c0/attachment.html>

More information about the ejabberd mailing list