|
rlm_mq - accounting module for FreeRADIUS to work with MQSeries
|
|||
---|---|---|---|
#18+
http://www.bicekru.org/~ggv I think today I'll change it a bit - will add acct-session-id to leg.x ... |
|||
:
Нравится:
Не нравится:
|
|||
04.08.2004, 16:24 |
|
rlm_mq - accounting module for FreeRADIUS to work with MQSeries
|
|||
---|---|---|---|
#18+
oops! не увидел сразу -- был в отпуске. посмотрю завтра-послезавтва. ... |
|||
:
Нравится:
Не нравится:
|
|||
17.08.2004, 19:29 |
|
rlm_mq - accounting module for FreeRADIUS to work with MQSeries
|
|||
---|---|---|---|
#18+
ничего не понятно в radius. зачем у тебя имена очередей приводятся в uppercase, когда они чувствительны к регистру? зачем commit/rollback? ты вроде put только одно сообщение, или я что-то не увидел.. MQPMO_NO_SYNCPOINT... у тебя даже сообщения не persistent, я не вижу, что здесь должна быть транзакция... ... |
|||
:
Нравится:
Не нравится:
|
|||
17.08.2004, 20:34 |
|
rlm_mq - accounting module for FreeRADIUS to work with MQSeries
|
|||
---|---|---|---|
#18+
int mq_init_pool(struct MQ_INST * inst) .......... if(connect_single(inst, mqconn) == 0) success = 1; /* Add this conn to the list of connections */ mqconn->next = inst->pool; inst->pool = mqconn; } inst->last_used = NULL; if (!success) { radlog(L_DBG, "rlm_mq: Failed to connect to queue manager."); return -1; } эта ... при ошибку на MQOPEN напишет "rlm_mq: Failed to open #%d queue %s with reason %ld" "rlm_mq: Failed to connect to queue manager." ползователь офигеет -- это мы проходили... ... |
|||
:
Нравится:
Не нравится:
|
|||
17.08.2004, 21:08 |
|
rlm_mq - accounting module for FreeRADIUS to work with MQSeries
|
|||
---|---|---|---|
#18+
нет. ... |
|||
:
Нравится:
Не нравится:
|
|||
17.08.2004, 21:10 |
|
rlm_mq - accounting module for FreeRADIUS to work with MQSeries
|
|||
---|---|---|---|
#18+
"ничего не понятно в radius." Can I help somehow? "зачем у тебя имена очередей приводятся в uppercase, когда они чувствительны к регистру?" platform - solaris. define qlocal(My.Queue) + bla-bla-bla radiusd -X connected correctly, queue name in uppercase. I have found that if queue name is not in uppercase - I won't connect. Probably in the doc there is something about solaris. Will check Linux/Aix "ползователь офигеет -- это мы проходили..." Thank - fixed. Any other suggestions? Thank you NewYear. Could you have a look at http://bicekru.org/~ggv/doc ? Any notes/suggestions are welcome. ... |
|||
:
Нравится:
Не нравится:
|
|||
17.08.2004, 21:53 |
|
rlm_mq - accounting module for FreeRADIUS to work with MQSeries
|
|||
---|---|---|---|
#18+
Oops, forgot to say - file mq.c, line 138 pmo.Options |= MQPMO_SYNCPOINT; And - it's nit for one PUT. FreeRADIUS is multithreaded application, and each thread will serve many accounting request, each one accounting request will be a message and requires PUT and MQCMIT. ... |
|||
:
Нравится:
Не нравится:
|
|||
17.08.2004, 22:46 |
|
rlm_mq - accounting module for FreeRADIUS to work with MQSeries
|
|||
---|---|---|---|
#18+
>define qlocal(My.Queue) + bla-bla-bla нужно define qlocal('My.Queue') + bla-bla-bla я не работаю с solaris, но сильно сомневаюсь, что там очереди в uppercase define qlocal(My.Queue) + bla-bla-bla сделает очередь в uppercase, точно. чтобы создалась не в uppercase, нужно взять ее в кавычки -- MQSC фича. у тебя была ошибка 2085? буду смотреть дальше. к сожалению, у меня нет никакой машины под unix, где я мог бы это собрать и запустить. доку не читал, но прочитаю. ... |
|||
:
Нравится:
Не нравится:
|
|||
18.08.2004, 10:39 |
|
rlm_mq - accounting module for FreeRADIUS to work with MQSeries
|
|||
---|---|---|---|
#18+
"чтобы создалась не в uppercase, нужно взять ее в кавычки -- MQSC" - got it, thanks. probably I did not read the doc carefully, but I did not remember something about queue names. Now I may get out upper(). ... |
|||
:
Нравится:
Не нравится:
|
|||
18.08.2004, 10:55 |
|
rlm_mq - accounting module for FreeRADIUS to work with MQSeries
|
|||
---|---|---|---|
#18+
There is an error - one MQHCONN shared by all threads of the same instance of the module. It means MQBACK or MQCMIT in one thread will commit/rollbak work in others. Fixing. ... |
|||
:
Нравится:
Не нравится:
|
|||
20.08.2004, 17:15 |
|
rlm_mq - accounting module for FreeRADIUS to work with MQSeries
|
|||
---|---|---|---|
#18+
да, на моей практике hconn может быть только один на процесс. я не знал, как MQCONN ведет себя в случае с multithread, поэтому не поднял тему. я думаю, это не пофиксишь. тебе ничего там на стоит убрать MQCMIT/MQBACK, не так ли? ... |
|||
:
Нравится:
Не нравится:
|
|||
20.08.2004, 17:47 |
|
rlm_mq - accounting module for FreeRADIUS to work with MQSeries
|
|||
---|---|---|---|
#18+
смотрим в доку. int mq_conn(struct MQ_INST *inst){ MQLONG CompCode, Reason; MQCNO Connect_options = {MQCNO_DEFAULT}; if(inst->config->mq_fastpath){ Connect_options.Options = MQCNO_FASTPATH_BINDING; radlog(L_DBG, "rlm_mq : using MQCN_FASTPATH_BINDING"); } radlog(L_DBG, "rlm_mq: Attempting to connect %s", inst->config->mq_qmngr); /* Connecting to Queue Manager */ MQCONNX(inst->config->mq_qmngr, &Connect_options, &inst->Hcon, &CompCode, &Reason); if(CompCode == MQCC_FAILED){ /* * Error */ radlog(L_CONS | L_ERR, "rlm_mq: Failed to connect MQ handle to queue manager %s with reason %ld", inst->config->mq_qmngr, (long)Reason); return -1; else if(CompCode == MQCC_WARNING && Reason == 2002) radlog(L_CONS | L_ERR, "rlm_mq: Seems you are connected yet to %s, probably in another instance of rlm_mq, it's not an error", inst->config->mq_qmngr); else if(CompCode == MQCC_WARNING && Reason != 2002) radlog(L_CONS | L_ERR, "rlm_mq: Got a warning when connected to queue manager %s with reason %ld", inst->config->mq_qmngr, (long)Reason); return 0; } может, так? Connect_options.Options = MQCNO_FASTPATH_BINDING |MQCNO_HANDLE_SHARE_NONE ... |
|||
:
Нравится:
Не нравится:
|
|||
20.08.2004, 18:54 |
|
rlm_mq - accounting module for FreeRADIUS to work with MQSeries
|
|||
---|---|---|---|
#18+
Programmers guide, file csqzal09.pdf, page 91, section "Scope of MQCONN or MQCONNX" "Within WebSphere MQ for iSeries, MQSeries for Compaq OpenVMS Alpha, MQSeries for OS/2 Warp, WebSphere MQ on Unix systems and WebSphere MQ for WIndows, the scope of an MQCONN or MQCONNX call is usually the thread that issued it. That is, the connection handle returned from the call is valid only within the thread that issued the call. ............ If you have multiple threads in your application and each wishes to use WebSphere MQ calls, each one must individually issue MQCONN or MQCONNX." page 94 "In the normal MQI environment the default value is MQCNO_HANDLE_SHARE_NONE" ... |
|||
:
Нравится:
Не нравится:
|
|||
21.08.2004, 09:29 |
|
rlm_mq - accounting module for FreeRADIUS to work with MQSeries
|
|||
---|---|---|---|
#18+
NewYear - just a simple example. #include <stdio.h> #include <stdlib.h> #include <cmqc.h> #include <pthread.h> #include <unistd.h> static void *dowork(void *arg){ MQHCONN mqconn; MQLONG CompCode, Reason; MQCNO Connect_options = {MQCNO_DEFAULT}; MQCONNX("sms", &Connect_options, &mqconn, &CompCode, &Reason); if(CompCode != MQCC_OK){ fprintf(stderr, "Connection returned %ld\n", (long)Reason); return NULL; } printf("thread %ld connected\n", (long)pthread_self()); sleep(10); return NULL; } int main(){ pthread_attr_t attr; pthread_t tid; int i; if(pthread_attr_init(&attr) != 0){ fprintf(stderr, "could not init attr\n"); exit(1); } for(i=0; i<3; ++i){ if(pthread_create(&tid, &attr, dowork, NULL) != 0){ fprintf(stderr, "Could not create thread\n"); exit(1); } } sleep(15); return 0; } cc -I /opt/mqm/inc/ -L /opt/mqm/lib -l mqm -mt test.c or gcc -Wall -I /opt/mqm/inc/ -L /opt/mqm/lib -l mqm test.c and we got ./a.out thread 3 connected thread 2 connected thread 4 connected rlm_mq got an logical error. I have taken a logic from existing rlm_sql, and just changed SQL stuff to MQ stuff. This was my mistake :) Ok, will fix. but MQCONN works in threads as described in the doc. ... |
|||
:
Нравится:
Не нравится:
|
|||
21.08.2004, 11:16 |
|
rlm_mq - accounting module for FreeRADIUS to work with MQSeries
|
|||
---|---|---|---|
#18+
Here how it is - two post above when I put a quotation from page 91, and I did skip very important statement. "If it is used from a different thread, it will be rejected as invalid". That's it. It means there is not way to make a pool of MQHCONN and use them from threads. Actually, rlm_mq is new stuff, was not used before, before I used door_x (3door) - SUN door interface, where each request from freeradius passed to door-server, and server created a new thread, which created each own MQHCONN. But door_x () is not portable. Anyhow, everything is clear now. Each thread has to create each own MQHCONN, otherways - Reason 2018. ... |
|||
:
Нравится:
Не нравится:
|
|||
21.08.2004, 13:41 |
|
|
start [/forum/topic.php?fid=43&fpage=152&tid=1606160]: |
0ms |
get settings: |
9ms |
get forum list: |
12ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
61ms |
get topic data: |
12ms |
get forum data: |
3ms |
get page messages: |
49ms |
get tp. blocked users: |
1ms |
others: | 14ms |
total: | 169ms |
0 / 0 |