| [email protected] writes:
>Two servers A and B. A creates and registers RPC services successfuly.
>B can successfully do an svctcp_create() but svc_register() fails.
Are the two servers separate machines or separate programs?
The
>value of errno after calling svc_register is 9 (EBADF).
Errno is set on error returns from system calls. It's generally
useless or confusing when examined after library calls unless you have
source code handy.
>> errno = 0;
>> SVCXPRT *transp = svctcp_create(RPC_ANYSOCK, 0, 0);
>> if (!transp) {
>> DPRINTTIMEC("omurpc", 3, "errno(svctcp_create) = %d", errno);
>> RAISE_RpcServiceCreateFail(Urgent, pv.prognum, pv.versnum);
>> }
>> errno = 0;
>> if (!svc_register(transp, pv.prognum, pv.versnum,
>> &ImRPCManager::handleRPC, IPPROTO_TCP)) {
>> DPRINTTIMEC("omurpc", 3, "errno(svc_register) = %d", errno);
>> RAISE_RpcServiceCreateFail(Urgent, pv.prognum, pv.versnum);
>> }
>>
>Would you have an idea of why svc_register() fails? I know that the
>port mapper does not have an entry for that program number.
The only two reasons are registering a second version of a RPC program
with a different dispatch routine or if a call to pmap_set fails.
pmap_set fails if it can't create a UDP client handle to portmap (which it
certainly should) or if the PMAPPROC_SET call fails (which will leave
an error message in a syslog file via "syslog(LOG_ERR, clnt_sperror(client,
"Cannot register service"));". If that's the case, the message in the
syslog file (daemon.log?) will have additional hints. If the client handle
create failed, the code may not have called clnt_pcreateerror(), so your
customer might try that too.
>Another question is: does using rpcinfo -t suffice as the means to
>perform a heartbeat check on RPC services for a particular program?
>I'm trying to use that instead of having to put together a small
>client program. In other words, doe rpcinfo -t use clnt_create()
>and all that good stuff?
Yes - it will call the NULL procedure of the target service.
--
<> Eric (Ric) Werme <> This space under reconstruction <>
<> <[email protected]> <> <>
[posted by Notes-News gateway]
|