On 14.07.2009 11:00 Uhr, Andrei Pelinescu-Onciul wrote:
On Jul 14, 2009 at 11:26, Juha Heinanen
<jh(a)tutpro.com> wrote:
mi trusted_reload fails like this:
srctl> mi trusted_reload
error: 400 - Trusted table reload failed
and syslog shows these error messages:
Jul 14 11:21:56 localhost /usr/sbin/sip-router[11658]: ERROR: <core> [db.c:422]:
invalid parameter value
Jul 14 11:21:56 localhost /usr/sbin/sip-router[11658]: ERROR: permissions [trusted.c:76]:
failed to use trusted table
It's probably because the DB connection is not init for the RPC
processes.
Initially I thought to call init_mi_child() in child_init(PROC_RPC) of
mi_rpc, but will get broken for modules that have both mi and rpc
commands -- I think lcr has them. So solution is to fix module by module
as I mentioned when fixing the domain module.
Cheers,
Daniel
permissions(k) init_child_trusted():
...
/* Check if database is needed by child */
if (db_mode==DISABLE_CACHE && rank>0) {
^^^^^^^^
persmissions(s) child_init():
...
/* Connect to the DB regarless of cache or non-cache mode,
because we either have to query the DB runtime, or reload
the cache via RPC call */
if (perm_init_db()) goto error;
An rpc process can have a special rank (e.g.: ctl forks an rpc handling
process with rank PROC_RPC) or it can be a normal tcp ser process (xmlrpc
with reuses ser processes).
So you should init the db connections for PROC_RPC, PROC_UNIXSOCK + all the
processes with rank>0 if you want access to it via ctl and xmlrpc.
Andrei
_______________________________________________
sr-dev mailing list
sr-dev(a)lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev