Date: Wed, 29 Sep 1999 16:17:49 EDT From: "Zhihui Zhang" <zzhangsuny@hotmail.com> To: freebsd-hackers@freebsd.org Subject: Help with registering RPC with inetd Message-ID: <19990929201753.28461.qmail@hotmail.com>
index | next in thread | raw e-mail
I have been able to register a RPC service with the inetd deamon by
modifying the /etc/inetd.conf and /etc/rpc files. The RPC code is
generated with the -I option, i.e., by using rpcgen -I myfile.x.
(For those who have read my previous post, I made a mistake there. The
program number is a hex 0x20000001, I should use its correcponding decimal
number in /etc/rpc, which is 536870913.)
Everything works fine. But the process of the PRC service does not exit
after 120 seconds as expected (120 seconds is the default value, I actually
waited much longer time for it to die). To find out the reason, I look into
the server stub created by rpcgen, especially the closedown() routine that
is invoked by the SIGALRM signal. The following code in this closedown()
routine explains the reason why the RPC service process refuses to die:
for (i = 0, openfd = 0; i < size && openfd < 2; i++)
if (FD_ISSET(i, &svc_fdset))
openfd++
if (openfd <= 1)
exit(0);
I add some syslog() statements in them and find out that besides
descriptor 0, descriptor 1063 is also set (the size is 1064, why this
large?). Who could possibly FD_SET() the descriptor 1063 into svc_fdset?
This makes openfd == 2. Therefore the RPC service process will not die even
after it has been idle for a long time.
I hope some one can give me a hint on this mystery. Any help is
appreciated.
-Zhihui
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990929201753.28461.qmail>
