Re: restart strategy for extauth
Jesse Thompson <jesse.thompson <at> doit.wisc.edu>
2011-09-07 22:31:31 GMT
Yes, you definitely won't want to start up a JVM for every
authentication request.
So, your options are:
1) Implement your desired crash-detection-restart code in ejabberd
(you'll need to learn to code in erlang, but if you're successful, then
you can share the feature back to the ejabberd community)
2) Make your java extauth program bullet proof so that it never crashes.
3) Use the technique that I describe, and implement it so that the
persistent extauth program communicates with a persistent java program.
Then implement the crash-detection-restart code in that extauth program.
Jesse
On 9/7/11 4:07 PM, Daniel Dormont wrote:
> Thanks Jesse. I'll certainly consider that, but I'm hesitant because
> authentication to Ejabberd is just one step in a many-part process
> that my users are going through at this point in my application, and
> this process (for reasons mostly not related to Ejabberd) is already
> slow enough as it is, so I'm hesitant to add more overhead. Especially
> so because the code that performs the actual work is written in Java
> and depends on Spring.
>
> dan
>
> On Wed, Sep 7, 2011 at 4:01 PM, Jesse Thompson
> <jesse.thompson <at> doit.wisc.edu> wrote:
>> It won't be restarted, so you will need to use your server monitoring tools
>> to make sure that the program is running.
>>
>> If your extauth program is complex (and consequently crashy), or you just
>> want the ability to change or restart the program after it is already
>> started, then I suggest you take a look at my post from 7/13/2011 with
>> Subject "Re: [ejabberd] multiple authentication methods: order and priority
>> of operation" where I discuss an approach that allows you to restart your
>> extauth program without restarting ejabberd.
>>
>> Jesse
>>
>> On 9/7/11 2:32 PM, Daniel Dormont wrote:
>>>
>>> Hi, I am using extauth and I'm running into a tricky situation: what
>>> happens if my extauth program crashes? As best I can tell, what
>>> happens is the port closes and subsequent auth requests fail with a
>>> message like:
>>>
>>> =CRASH REPORT==== 6-Sep-2011::17:33:02 ===
>>> crasher:
>>> initial call: gen:init_it/6
>>> pid:<0.20948.0>
>>> registered_name: []
>>> exception exit: {badarg,[{extauth,call_port,2},
>>>
>>> {ejabberd_auth_external,check_password_extauth,3},
>>> {ejabberd_auth,check_password_loop,2},
>>> {cyrsasl_plain,mech_step,2},
>>> {cyrsasl,server_step,2},
>>> {ejabberd_c2s,wait_for_feature_request,2},
>>> {p1_fsm,handle_msg,10},
>>> {proc_lib,init_p_do_apply,3}]}
>>> in function p1_fsm:terminate/7
>>> ancestors: [ejabberd_c2s_sup,ejabberd_sup,<0.38.0>]
>>> messages: []
>>> links: [<0.263.0>]
>>> dictionary:
>>> [{'$internal_queue_len',0},{random_seed,{12982,22012,13984}}]
>>> trap_exit: false
>>> status: running
>>> heap_size: 6765
>>> stack_size: 24
>>> reductions: 3268
>>> neighbours:
>>>
>>> Can extauth be configured to restart the program automatically? thanks,
>>>
>>> dan
>>> _______________________________________________
>>> ejabberd mailing list
>>> ejabberd <at> jabber.ru
>>> http://lists.jabber.ru/mailman/listinfo/ejabberd
>>
>>
>> _______________________________________________
>> ejabberd mailing list
>> ejabberd <at> jabber.ru
>> http://lists.jabber.ru/mailman/listinfo/ejabberd
>>
>>
> _______________________________________________
> ejabberd mailing list
> ejabberd <at> jabber.ru
> http://lists.jabber.ru/mailman/listinfo/ejabberd
_______________________________________________
ejabberd mailing list
ejabberd <at> jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd