From: thuan@hpltp.hpl.hp.com (Thuan Q. Pham)
Subject: Re: [DCE] unexporting/unregistering servers
Date: Fri, 17 Sep 1993 23:12:04 GMT [thread overview]
Message-ID: <THUAN.93Sep17151204@hpltp.hpl.hp.com> (raw)
In-Reply-To: scooper@cse.ucsc.edu's message of 17 Sep 1993 19:58:54 GMT
In article <27d4tuINNdcq@darkstar.UCSC.EDU> scooper@cse.ucsc.edu (Scott Cooper) writes:
> I have some simple RPC clients and servers which do not behave
> properly if the server is killed. What is the proper procedure to go
> through to unregister a server interface, unexport its bindings, and
> unregister its endpoints? I have been unable to decipher the
> DCE documentation on this point.
If you want to do clean up (which we should), call the unexport routines.
These are very similar to the export routines you call when you set the
server up:
quitServer()
{
rpc_ep_unregister() /* clean up the local endpoint mapper */
rpc_ns_binding_unexport() /* unregister the interface from name space */
rpc_binding_vector_free() /* if you still have binding vectors around */
}
etc.. etc.. There are other functions to call (such as group unexport,
the nsa_***(), etc.. ). But he rule of thumb is that you should undo what
you did. Look at what call you make to register stuff and simply call the
ones to unregister them.
> We are talking about the simplest possible client/server
> relationship here: no UUIDs, only one interface exported per server, etc.
> I would eventually like to provide for the following things:
> 1) The server should unregister itself if it is killed.
If you mean kill itself gracefully when you hit ^C, then you have to handle
the UNIX signals. To handle this (like control-C), we must start a thread
to handle the signal. Couldn't be done otherwise. The thread create a
signal mask, and actually block with a call to sigwait(). When a signal
is present, it unblocks, stops the server from accepting new calls, and
cause it to exit when the last existing rpc call is handled. (really
graceful exit). Then, it breaks the server-listen loop and start the clean
up routine. (Just register a signal handling routine by calling signal()
isn't good enough).
>2) Authorized clients should be able to indicate that the server should
>shut down
Server should support a function that enable a client to call it and tell
it to kill itself.
>3) Some kind of manager program should be able to shut down the server.
Same as 2), I don't see much difference here.
> Clues on any or all of the above are greatly appreciated -
> I really need to get past this snag to get on with a stub compiler
> that I am building.
Hope it works for you. Works for me so far....
/Thuan
-------------------------------------------------------------------
Thuan Q. Pham
Hewlett-Packard Laboratories (415) 857-6818
1501 Page Mill Road pham@hpl.hp.com
Palo Alto, Ca 94303
next prev parent reply other threads:[~1993-09-17 23:12 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
1993-09-17 19:58 [DCE] unexporting/unregistering servers Scott Cooper
1993-09-17 23:12 ` Thuan Q. Pham [this message]
1993-09-18 0:59 ` Nathaniel Mishkin
1993-09-19 15:30 ` Lee Sailer
1993-09-20 16:25 ` Rich Salz
1993-09-21 6:27 ` Bjorn Hell Larsen
1993-09-21 15:54 ` Rich Salz
1993-09-21 21:50 ` Thuan Q. Pham
1993-09-22 6:49 ` Bjorn Hell Larsen
1993-09-23 13:17 ` Nathaniel Mishkin
1993-09-23 18:49 ` Thuan Q. Pham
1993-09-24 14:15 ` Nathaniel Mishkin
1993-09-24 15:38 ` Jon Mauney
1993-09-26 18:48 ` Nathaniel Mishkin
1993-09-22 13:53 ` Rich Salz
1993-09-23 6:41 ` Bjorn Hell Larsen
1993-09-23 14:03 ` Rich Salz
1993-09-23 13:20 ` Nathaniel Mishkin
1993-09-23 18:38 ` Rich Salz
1993-09-24 14:06 ` Nathaniel Mishkin
1993-09-25 14:35 ` Lee Sailer
1993-09-21 12:25 ` Nathaniel Mishkin
1993-09-20 16:00 ` Greg Brail
1993-09-21 6:18 ` Bjorn Hell Larsen
1993-09-21 15:28 ` Greg Brail
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox