VMS Help
DCE, dce_intro, dced_intro, Server Execution Control Routines

 *Conan The Librarian (sorry for the slow response - running on an old VAX)

  dced_server_disable_if
                      Disables a service provided by a server

  dced_server_enable_if
                      Re-enables a service provided by a server

  dced_server_stop    Stops a DCE-configured server

  1 - dced_server_disable_if

 NAME

   dced_server_disable_if - Disables a service (rpc interface)
                            provided by a specific server on a
                            specific host

 SYNOPSIS

   #include <dce/dced.h>

   void dced_server_disable_if( dced_binding_handle_t  dced_bh,
                                uuid_t                 *exec_uuid,
                                rpc_if_id_t            *interface,
                                error_status_t         *status );

 PARAMETERS

   Input

   dced_bh
       Specifies the dced binding handle for the srvrexec service
       on a specific host.

   exec_uuid
       Specifies the UUID that dced uses to identify the running
       server.

   interface
       Specifies the RPC interface identifier that represents the
       service to be disabled.  The interface identifier is generated
       when idl compiles an interface definition file.  The interface
       identifier is an rpc_if_id_t structure that contains the
       interface UUID (uuid) of type uuid_t, and numbers of type
       unsigned16 representing the major (vers_major) and minor
       (vers_minor) version numbers for the interface.

   Output

   status
       Returns the status code from this routine.  This status code
       indicates whether the routine completed successfully or, if
       not, why not.  The possible status codes are:

            error_status_ok
            db_s_bad_index_type
            db_s_iter_not_allowed
            db_s_readonly
            db_s_store_failed
            dced_s_bad_binding
            dced_s_not_found
            sec_acl_invalid_permission

 DESCRIPTION

   The dced_server_disable_if() routine disables a service provided
   by a server on a specific host.  A service is represented by an
   RPC interface identifier.  Management applications use this
   routine to remotely disable an interface so it is inaccessible by
   clients, without completely stopping the entire server.

   When a server starts and initializes itself, it must call the
   dce_server_register() routine to enable all of its services.
   The server can then disable its own individual services by using
   dce_server_disable_service().  This routine unregisters the
   service's interface from the RPC runtime and marks the interface
   as disabled in the endpoint map.  As an alternative, a management
   application can use dced_server_disable_if() to disable individual
   services.  However, this routine only affects the endpoint map in
   dced by marking the interface as disabled and does not affect the
   server's runtime.

   A management application can re-enable a service again by calling
   the dced_server_enable_if() routine.  (Servers re-enable their
   own services using the dce_server_enable_if() routine.)

   Prior to calling dced_server_disable_if(), the application must
   have established a valid dced binding handle to the srvrexec
   service by calling either dced_binding_create() or
   dced_binding_from_rpc_binding().

 RELATED INFORMATION

   Routines:   dce_server_register
               dce_server_disable_if
               dce_server_enable_if
               dced_server_enable_if
               dced_binding_create
               dced_binding_from_rpc_binding

   dcecp Objects: server

   Books: OSF DCE Application Development Guide.

  2 - dced_server_enable_if

 NAME

   dced_server_enable_if - Enables a service (rpc interface) of
                           a specific server on a specific host

 SYNOPSIS

   #include <dce/dced.h>

   void dced_server_enable_if( dced_binding_handle_t  dced_bh,
                               uuid_t                 *exec_uuid,
                               rpc_if_id_t            *interface,
                               error_status_t         *status );

 PARAMETERS

   Input

   dced_bh
       Specifies the dced binding handle for the srvrexec service
       on a specific host.

   exec_uuid
       Specifies the UUID that dced uses to identify the running
       server.

   interface
       Specifies the RPC interface identifier that represents the
       service to be enabled.  The interface identifier is generated
       when idl compiles an interface definition file.  The interface
       identifier is a structure that contains the interface UUID
       (interface->uuid), and the major (interface->vers_major) and
       minor (interface->vers_minor) version numbers for the interface.

   Output

   status
       Returns the status code from this routine.  This status code
       indicates whether the routine completed successfully or, if
       not, why not. The possible status codes are:

            error_status_ok
            db_s_bad_index_type
            db_s_iter_not_allowed
            db_s_readonly
            db_s_store_failed
            dced_s_bad_binding
            dced_s_not_found
            sec_acl_invalid_permission

 DESCRIPTION

   The dced_server_enable_if() routine enables a service (or re-enables
   a previously disabled service) that a specific server provides.
   Management applications use this routine.  A service is represented
   by an RPC interface identifier.

   When a server starts and initializes itself, it typically calls
   the dce_server_register() routine to enable all of its services.
   The services can then be disabled and re-enabled, as needed.  A
   server enables and disables its own services by using
   dce_server_enable_service() and dce_server_disable_service() and
   a management application enables and disables a remote server's
   service using dced_server_enable_if() and dced_server_disable_if().
   The dce_server* routines affect both the RPC runtime and the local
   endpoint map by registering (or unregistering) with the runtime
   and setting a flag for the interface in the the endpoint map as
   enabled (or disabled).  The dced_server_enable_if() and
   dced_server_disable_if() routines affect only the remote endpoint
   map by setting the flag.

   Prior to calling dced_server_enable_if(), the application must
   have established a valid dced binding handle to the srvrexec
   service by calling either dced_binding_create() or
   dced_binding_from_rpc_binding().

 RELATED INFORMATION

   Routines:   dce_server_register
               dce_server_enable_if
               dce_server_disable_if
               dced_server_disable_if
               dced_binding_create
               dced_binding_from_rpc_binding

   dcecp Objects: server

   Books: OSF DCE Application Development Guide.

  3 - dced_server_stop

 NAME

   dced_server_stop - Stops a DCE-configured server running on a
                      specific host

 SYNOPSIS

   #include <dce/dced.h>

   void dced_server_stop( dced_binding_handle_t   dced_bh,
                          uuid_t                  *exec_uuid,
                          srvrexec_stop_method_t  method,
                          error_status_t          *status );

 PARAMETERS

   Input

   dced_bh
       Specifies the dced binding handle for the srvrexec service
       on a specific host.

   exec_uuid
       Specifies a UUID that dced uses to identify the running server.
       If the value input is dced_g_uuid_all_servers, then dced
       attempts to stop all the DCE servers running on that host.

   method
       Specifies the method dced uses to stop a server.  A method is
       represented by one of the following values:

       srvrexec_stop_rpc
                     Uses the rpc_mgmt_stop_server_listening routine.
                     This is the cleanest way to stop a server
                     because it waits for outstanding remote procedure
                     calls to finish before making the server's
                     rpc_server_listen() routine return.

       srvrexec_stop_soft
                     Uses a "soft" local host mechanism (such as the
                     TERM signal in UNIX)

       srvrexec_stop_hard
                     Uses a "hard" local host mechanism (such as the
                     KILL signal in UNIX)

       srvrexec_stop_error
                     Uses a mechanism that saves the program state
                     (such as the ABORT signal in UNIX)

   Output

   status
       Returns the status code from this routine.  This status code
       indicates whether the routine completed successfully or, if
       not, why not.  The possible status codes are:

            error_status_ok
            dced_s_bad_binding
            dced_s_no_support
            dced_s_not_found
            rpc_s_binding_incomplete
            rpc_s_comm_failure
            rpc_s_invalid_binding
            rpc_s_mgmt_op_disallowed
            rpc_s_unknown_if
            rpc_s_wrong_kind_of_binding
            sec_acl_invalid_permission
            uuid_s_bad_version

 DESCRIPTION

   The dced_server_stop() routine stops DCE-configured servers on
   specific hosts.   When the server is completely stopped and no
   longer a running process, dced deletes the associated execution
   data it maintained.

   Administrators use the dcecp operations server create and server
   start to configure and start a server, and management applications
   use the associated dced_server_create() and dced_server_start()
   routines.

   Prior to calling dced_server_stop(), the application must have
   established a valid dced binding handle to the srvrexec service
   by calling either dced_binding_create() or
   dced_binding_from_rpc_binding().

 CAUTIONS

   Using the value dced_g_uuid_all_servers for the exec_uuid parameter
   causes dced to shutdown all servers including itself.

 EXAMPLES

   The following example obtains dced binding handles to the server
   configuration and execution services of dced on the host patrick.
   The example then checks to see if the server is running by seeing
   if dced has a UUID and entry for the executing server.  However,
   the server may be in the process of starting up or stopping, so the
   example also checks to be sure the instance UUID of the running
   server matches the UUID of the configuration for that server. If
   there is a match, the server is running.  Finally, the example
   stops the server by calling dced_server_stop() with the
   srvrexec_stop_rpc parameter.

        dced_binding_handle_t conf_bh, exec_bh;
        dced_string_t         server_name;
        void                  *data;
        server_t              *exec_ptr;
        uuid_t                srvrconf_id, srvrexec_id;
        error_status_t        status;
         .
         .
         .
        dced_binding_create( "srvrconf@hosts/patrick",
                             dced_c_binding_syntax_default,
                             &conf_bh,
                             &status );
        dced_binding_create( "srvrexec@hosts/patrick",
                             dced_c_binding_syntax_default,
                             &exec_bh,
                             &status) ;
     /* is server running? */
        dced_inq_id( exec_bh, server_name, &srvrexec_id, &status );
     /* also check to be sure server is not coming up or going down */
        dced_object_read( exec_bh, &srvrexec_id, &data, &status );
        exec_ptr = (server_t*)data;
        dced_inq_id( conf_bh, server_name, &srvrconf_id, &status );
        if (uuid_equal( &srvrconf_id,
            &exec_ptr->exec_data.tagged_union.running_data.instance,
            &status) ) {
            dced_server_stop( exec_bh,
                              &srvrexec_id,
                              srvrexec_stop_rpc,
                              &status );
        }
        dced_objects_release( exec_bh, 1, data, &status );
        dced_binding_free( conf_bh, &status );
        dced_binding_free( exec_bh, &status );

 RELATED INFORMATION

   Routines:   dced_server_create
               dced_server_start
               rpc_mgmt_stop_server_listening
               dced_binding_create
               dced_binding_from_rpc_binding

   dcecp Objects: server

   Books: OSF DCE Application Development Guide.
  Close     HLB-list     TLB-list     Help  

[legal] [privacy] [GNU] [policy] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.