'\" te .\" Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] .TH NSCD 8 "Mar 6, 2017" .SH NAME nscd \- name service cache daemon .SH SYNOPSIS .LP .nf \fB/usr/sbin/nscd\fR [\fB-f\fR \fIconfiguration-file\fR] [\fB-g\fR] [\fB-e\fR \fIcachename\fR, yes | no] [\fB-i\fR \fIcachename\fR] .fi .SH DESCRIPTION .LP The \fBnscd\fR daemon is a process that provides a cache for most name service requests. The default \fIconfiguration-file\fR \fB/etc/nscd.conf\fR determines the behavior of the cache daemon. See \fBnscd.conf\fR(5). .sp .LP \fBnscd\fR provides caching for the \fBpasswd\fR(5), \fBgroup\fR(5), \fBhosts\fR(5), \fBipnodes\fR(5), \fBexec_attr\fR(5), \fBprof_attr\fR(5), \fBuser_attr\fR(5), \fBethers\fR(5), \fBrpc\fR(5), \fBprotocols\fR(5), \fBnetworks\fR(5), \fBbootparams\fR(5), \fBauth_attr\fR(5), \fBservices\fR(5), \fBnetmasks\fR(5), \fBprinters\fR(5), \fBproject\fR(5) databases through standard \fBlibc\fR interfaces, such as \fBgethostbyname\fR(3NSL), \fBgetipnodebyname\fR(3SOCKET), \fBgethostbyaddr\fR(3NSL), and others. Each cache has a separate time-to-live for its data; modifying the local database (\fB/etc/hosts\fR, \fB/etc/resolv.conf\fR, and so forth) causes that cache to become invalidated upon the next call to \fBnscd\fR. The shadow file is specifically not cached. \fBgetspnam\fR(3C) calls remain uncached as a result. .sp .LP \fBnscd\fR also acts as its own administration tool. If an instance of \fBnscd\fR is already running, commands are passed to the running version transparently. .sp .LP When running with per-user lookups enabled (see \fBnscd.conf\fR(5)), \fBnscd\fR forks one and only one child process (that is, a per-user \fBnscd\fR) on behalf of the user making the request. The per-user \fBnscd\fR will use the credentials of the user to open a per-user connection to the name repository configured for the per-user style of lookups. The lookup will be performed in the child process. The results are cached in the process and are available only to the same user. The caches are managed exactly the same as the main \fBnscd\fR daemon manages its own caches. Subsequent requests from the user will be handled by that per-user \fBnscd\fR until it terminates. The per-user \fBnscd\fR uses a configurable inactivity time-to-live (TTL) value and terminates itself after the inactivity TTL expires. .sp .LP The maximum number of per-user \fBnscd\fRs that can be created by the main \fBnscd\fR is configurable (see \fBnscd.conf\fR(5)). After the maximum number of them are created, the main \fBnscd\fR will use an LRU algorithm to terminate less active child \fBnscd\fRs as needed. .sp .LP The main \fBnscd\fR daemon creates, monitors, and manages all the child \fBnscd\fRs. It creates a user's own \fBnscd\fR upon receiving the user's first per-user lookup. When the \fBnscd\fR daemon is started, if per-user lookups are enabled, it checks to ensure all conditions are met before getting ready to create a per-user \fBnscd\fR. When the daemon is stopped, it terminates all the per-user \fBnscd\fRs under its control. .sp .LP Per-user \fBnscd\fRs use the same configuration as the main \fBnscd\fR. They read and use the same default configuration file or the one specified with the \fB-f\fR command line option. Once the configuration is read, the per-user \fBnscd\fR will use it for its entire lifetime. .SH OPTIONS .LP Several of the options described below require a \fIcachename\fR specification. Supported values for \fIcachename\fR are: \fBpasswd\fR, \fBgroup\fR, \fBhosts\fR, \fBipnodes\fR, \fBexec_attr\fR, \fBprof_attr\fR, \fBuser_attr\fR, \fBethers\fR, \fBrpc\fR, \fBprotocols\fR, \fBnetworks\fR, \fBbootparams\fR, \fBauth_attr\fR, \fBservices\fR, \fBnetmasks\fR, \fBprinters\fR, and \fBproject\fR. .sp .ne 2 .na \fB\fB-f\fR \fIconfiguration-file\fR\fR .ad .sp .6 .RS 4n Causes \fBnscd\fR to read its configuration data from the specified file. .RE .sp .ne 2 .na \fB\fB-g\fR\fR .ad .sp .6 .RS 4n Prints current configuration and statistics to standard output. This is the only option executable by non-root users. .RE .sp .ne 2 .na \fB\fB-e\fR \fIcachename\fR\fB, yes\fR|\fBno\fR\fR .ad .sp .6 .RS 4n Enables or disables the specified cache. .RE .sp .ne 2 .na \fB\fB-i\fR \fIcachename\fR\fR .ad .sp .6 .RS 4n Invalidate the specified cache. .RE .SH EXAMPLES .LP \fBExample 1 \fRStopping and restarting the \fBnscd\fR daemon. .sp .in +2 .nf example# svcadm disable system/name-service-cache example# svcadm enable system/name-service-cache .fi .in -2 .sp .SH FILES .ne 2 .na \fB\fB/etc/nscd.conf\fR\fR .ad .RS 18n Determines athe behavior of the cache daemon .RE .SH SEE ALSO .LP .BR svcs (1), .BR getspnam (3C), .BR gethostbyname (3NSL), .BR getipnodebyname (3SOCKET), .BR auth_attr (5), .BR bootparams (5), .BR ethers (5), .BR exec_attr (5), .BR group (5), .BR hosts (5), .BR netmasks (5), .BR networks (5), .BR nscd.conf (5), .BR nsswitch.conf (5), .BR passwd (5), .BR printers (5), .BR prof_attr (5), .BR project (5), .BR protocols (5), .BR rpc (5), .BR services (5), .BR user_attr (5), .BR attributes (7), .BR svcadm (8) .SH NOTES .LP The output from the \fB-g\fR option to \fBnscd\fR is subject to change. Do not rely upon it as a programming interface. .sp .LP The \fBnscd\fR service is managed by the service management facility, \fBsmf\fR(7), under the service identifier: .sp .in +2 .nf svc:/system/name-service-cache .fi .in -2 .sp .sp .LP Administrative actions on this service, such as enabling, disabling, or requesting restart, can be performed using \fBsvcadm\fR(8). The service's status can be queried using the \fBsvcs\fR(1) command.