From owner-freebsd-hackers Wed Sep 29 11:56:38 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from bingsun2.cc.binghamton.edu (bingsun2.cc.binghamton.edu [128.226.6.4]) by hub.freebsd.org (Postfix) with ESMTP id 73AE61592A for ; Wed, 29 Sep 1999 11:56:01 -0700 (PDT) (envelope-from bf20761@binghamton.edu) Received: from localhost (bf20761@localhost) by bingsun2.cc.binghamton.edu (8.9.3/8.9.3) with ESMTP id OAA13810 for ; Wed, 29 Sep 1999 14:56:00 -0400 (EDT) X-Authentication-Warning: bingsun2.cc.binghamton.edu: bf20761 owned process doing -bs Date: Wed, 29 Sep 1999 14:56:00 -0400 (EDT) From: Zhihui Zhang X-Sender: bf20761@bingsun2 To: freebsd-hackers@FreeBSD.ORG Subject: Help with registering RPC with inetd Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message