dced_server_create(3dce) — Subroutines
Name
dced_server_create - Creates a DCE server’s configuration data for the host’s dced
Synopsis
#include <dce/dced.h> void dced_server_create(
dced_binding_handle_t dced_bh,
server_t ∗conf_data,
error_status_t ∗status);
Parameters
Input
dced_bhSpecifies the dced binding handle for the srvrconf service on a specific host.
Input/Output
conf_dataSpecifies the configuration data for the server. The dced_intro(3dce) reference page describes the server_t structure.
Output
statusReturns the status code from this routine. This status code indicates whether the routine completed successfully or, if not, why not.
Description
The dced_server_create() routine creates a server’s configuration data. This routine is used by management installation applications to remotely (or locally) establish the data used to control how a DCE server starts. However, this routine does not create the program or start it. Since this activity is typically part of a server’s installation, you can also use dcecp’s server create operation.
Management applications use the dced_object_read() routine to read the configuration data.
Prior to calling dced_server_create(), the application must have established a valid dced binding handle to the srvrconf service by calling either dced_binding_create() or dced_binding_from_rpc_binding().
Examples
The following example shows how to fill in some of the fields of a server_t structure and then create the configuration in dced.
dced_binding_handle_t dced_bh;
server_t conf;
error_status_t status;
dced_binding_create("srvrconf@hosts/katharine",
dced_c_binding_syntax_default,
&dced_bh,
&status);
/∗ setup a server_t structure ∗/
uuid_create(&conf.id, &status);
conf.name = (dced_string_t)"application";
conf.entryname = (dced_string_t)"/.:/development/new_app";
conf.services.count = 1;
/∗ service_t structure(s) ∗/
conf.services.list = malloc(conf.services.count ∗ sizeof(service_t));
rpc_if_inq_id(application_v1_0_c_ifspec, &(conf.services.list[0].ifspec), &status);
conf.services.list[0].ifname = (dced_string_t)"application";
conf.services.list[0].annotation = (dced_string_t)"A new application";
conf.services.list[0].flags = 0;
/∗ server_fixedattr_t structure ∗/
conf.fixed.startupflags = server_c_startup_explicit | server_c_startup_on_failure;
conf.fixed.flags = 0;
conf.fixed.program = (dced_string_t)"/usr/users/bin/new_app";
dced_server_create(dced_bh, &conf, &status);
.
.
.
Errors
The following describes a partial list of errors that might be returned. Refer to the OSF DCE Problem Determination Guide for complete descriptions of all error messages.
error_status_ok
db_s_bad_header_type
db_s_bad_index_type
db_s_iter_not_allowed
db_s_key_not_found
db_s_readonly
db_s_store_failed
dced_s_already_exists
dced_s_bad_binding
dced_s_name_missing
sec_acl_invalid_permission
Related Information
dcecp objects: server(8dce).
Functions: dced_binding_create(3dce), dced_binding_from_rpc_binding(3dce), dced_object_read(3dce).
Books: OSF DCE Application Development Guide.