Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Sep 1999 14:56:00 -0400 (EDT)
From:      Zhihui Zhang <bf20761@binghamton.edu>
To:        freebsd-hackers@FreeBSD.ORG
Subject:   Help with registering RPC with inetd
Message-ID:  <Pine.GSO.BU-L4.10.9909291426460.26782-100000@bingsun2>

next in thread | raw e-mail | index | archive | help

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.BU-L4.10.9909291426460.26782-100000>