cb5caa98562cf06753163f558cbcfe30b8f4673adjl * CDDL HEADER START
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * The contents of this file are subject to the terms of the
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * Common Development and Distribution License (the "License").
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * You may not use this file except in compliance with the License.
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * See the License for the specific language governing permissions
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * and limitations under the License.
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * When distributing Covered Code, include this CDDL HEADER in each
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * If applicable, add the following below this CDDL HEADER, with the
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * fields enclosed by brackets "[]" replaced with your own identifying
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * information: Portions Copyright [yyyy] [name of copyright owner]
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * CDDL HEADER END
cfed26cb92bcaf129a6022a551f26391e5841135Michen Chang * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * Use is subject to license terms.
e37190e5b4531a897e4191a30b8f41678b582e25michen * remember when main or forker nscd starts.
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * allocate the space for tables
e37190e5b4531a897e4191a30b8f41678b582e25michen if ((rc = _nscd_alloc_nsw_config()) != NSCD_SUCCESS ||
e37190e5b4531a897e4191a30b8f41678b582e25michen (rc = _nscd_alloc_service_state_table()) != NSCD_SUCCESS ||
e37190e5b4531a897e4191a30b8f41678b582e25michen (rc = _nscd_alloc_nsw_state_base()) != NSCD_SUCCESS ||
e37190e5b4531a897e4191a30b8f41678b582e25michen (rc = _nscd_alloc_nsw_be_info_db()) != NSCD_SUCCESS ||
e37190e5b4531a897e4191a30b8f41678b582e25michen (rc = _nscd_alloc_getent_ctx_base()) != NSCD_SUCCESS)
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * allocate the space for local configuration
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * and statistics
e37190e5b4531a897e4191a30b8f41678b582e25michen if ((rc = _nscd_alloc_switch_cfg()) != NSCD_SUCCESS ||
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * Create and init the internal address database to keep
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * track of the memory allocated by _nscd_alloc
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * Create and init the internal context database to keep
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * track of the getent context currently being used
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * Create the backend info database for each possible source
cb5caa98562cf06753163f558cbcfe30b8f4673adjl if ((rc = _nscd_init_all_nsw_be_info_db()) != NSCD_SUCCESS) {
cb5caa98562cf06753163f558cbcfe30b8f4673adjl (me, "_nscd_init_all_nsw_be_info_db failed (rc = %d)\n",
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * Create the nscd_nsw_config_t for each possible nss database
cb5caa98562cf06753163f558cbcfe30b8f4673adjl if ((rc = _nscd_init_all_nsw_config()) != NSCD_SUCCESS) {
cb5caa98562cf06753163f558cbcfe30b8f4673adjl (me, "_nscd_init_all_nsw_config failed (rc = %d)\n", rc);
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * initialize config/stats management
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * read in the nsswitch configuration
cb5caa98562cf06753163f558cbcfe30b8f4673adjl rc = _nscd_cfg_read_nsswitch_file("/etc/nsswitch.conf", &err);
cb5caa98562cf06753163f558cbcfe30b8f4673adjl gettext("reading config file %s failed with rc = %d, %s\n"),
cb5caa98562cf06753163f558cbcfe30b8f4673adjl (me, "unable to read /etc/nsswitch.conf (rc = %d)\n", rc);
80b80bf0416a7eb4be4215b2e192cafd03ca80b7michen * remember which version of /etc/nsswitch.conf that was read
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * read in the nscd configuration
cb5caa98562cf06753163f558cbcfe30b8f4673adjl gettext("reading config file %s failed with rc = %d, %s\n"),
80b80bf0416a7eb4be4215b2e192cafd03ca80b7michen (me, "unable to read configuration from %s (rc = %d)\n",
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * remember the name of the config file
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * in case refresh is requested later
cb5caa98562cf06753163f558cbcfe30b8f4673adjl * re-read the nscd configuration
cb5caa98562cf06753163f558cbcfe30b8f4673adjl "unable to read the config file %s (rc = %d), %s\n",
80b80bf0416a7eb4be4215b2e192cafd03ca80b7michen "unable to parse the config file %s (rc = %d), %s\n",
cfed26cb92bcaf129a6022a551f26391e5841135Michen Chang (me, "nscd configuration refreshed successfully\n");