From owner-freebsd-hackers Wed Sep 29 13:18: 0 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from hotmail.com (f176.law4.hotmail.com [216.33.149.176]) by hub.freebsd.org (Postfix) with SMTP id 85826158DD for ; Wed, 29 Sep 1999 13:17:53 -0700 (PDT) (envelope-from zzhangsuny@hotmail.com) Received: (qmail 28462 invoked by uid 0); 29 Sep 1999 20:17:53 -0000 Message-ID: <19990929201753.28461.qmail@hotmail.com> Received: from 128.226.3.47 by www.hotmail.com with HTTP; Wed, 29 Sep 1999 13:17:49 PDT X-Originating-IP: [128.226.3.47] From: "Zhihui Zhang" To: freebsd-hackers@freebsd.org Subject: Help with registering RPC with inetd Date: Wed, 29 Sep 1999 16:17:49 EDT Mime-Version: 1.0 Content-Type: text/plain; format=flowed Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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