From: gjb@fig.citib.com (Greg Brail)
Subject: Re: [DCE] unexporting/unregistering servers
Date: Mon, 20 Sep 1993 16:00:20 GMT [thread overview]
Message-ID: <CDntsL.Lvn@fig.citib.com> (raw)
In-Reply-To: THUAN.93Sep17151204@hpltp.hpl.hp.com
In article <THUAN.93Sep17151204@hpltp.hpl.hp.com>,
Thuan Q. Pham <thuan@hpltp.hpl.hp.com> wrote:
>
>In article <27d4tuINNdcq@darkstar.UCSC.EDU> scooper@cse.ucsc.edu (Scott Cooper) writes:
>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).
Good explanation, but to clarify:
Call that "quitServer" routine that Thuan described after your call to
rpc_server_listen. In your signal handler, call
rpc_mgmt_stop_server_listening with a binding handle parameter of
NULL. This will make the server stop accepting RPCs and make
rpc_server_listen return.
>>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.
No need to bother if you don't feel like it. If you use
rpc_mgmt_stop_server_listening in your signal handler like I described
above, then any client can call it too once it has a binding to your
server. However, your server must call rpc_mgmt_set_authorization_fn
to register a callback that DCE will call whenever the client calls a
management routine. By default, stop_server_listening calls from
remote clients are rejected. Your callback must decide if the client
is authorized, then return "TRUE" if it wants the shutdown request to
be accepted.
greg
--
Greg Brail ------------------ Citibank -------------------- gjb@fig.citib.com
next prev parent reply other threads:[~1993-09-20 16:00 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
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 [this message]
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