Go to main content

man pages section 8: System Administration Commands

Exit Print View

Updated: Thursday, June 13, 2019
 
 

nscfg(8)

Name

nscfg - import, export name service configurations

Synopsis

/usr/sbin/nscfg command [cmd_options] [operands]
/usr/sbin/nscfg import [-fnvq] FMRI]
/usr/sbin/nscfg export [-nvq] FMRI]
/usr/sbin/nscfg unconfig [-nvq] FMRI]
/usr/sbin/nscfg validate [-vq] FMRI]
/usr/sbin/nscfg help

Description

The nscfg utility imports or exports legacy name service configuration files into or out of the SMF repository. Given a valid SMF configuration and corresponding FMRI, nscfg will regenerate the legacy naming service configuration files, such as nsswitch.conf , resolv.conf, nscd.conf, and so forth, into their legacy locations. Alternatively, nscfg can import those same configuration files populating the SMF repository if it is currently unpopulated.

The following are SMF services that can be operands to nscfg. In many instances, the legacy configuration file that is replaced by the SMF service is listed.

svc:/system/name-service/switch:default

Legacy file: /etc/nsswitch.conf

Name service switch configuration (used by nscd).

svc:/system/name-service/cache:default

Legacy file: /etc/nscd.conf

Name service cache (nscd).

svc:/network/dns/client:default

Legacy file: /etc/resolv.conf

DNS naming service.

svc:/network/nis/domain:default

Legacy file: /etc/defaultdomain

Legacy file: /var/yp/binding/$DOMAIN/*

Shared NIS domain configuration. Used by all NIS services. Also (historical) shared use with LDAP naming services. Must be enabled when using nis/client or ldap/client.

svc:/network/nis/client:default

NIS client naming service (ypbind and related)

svc:/network/ldap/client:default

Legacy file: /var/ldap/*

LDAP client naming service (ldap_cachemgr and related).

svc:/network/nis/server:default

NIS server service (ypserv).

svc:/network/nis/passwd:default

NIS server passwd service (rpc.yppasswd).

svc:/network/nis/xfr:default

NIS server xfr service (ypxfrd)

svc:/network/nis/update:default

NIS server update service (rpc.ypupdated)

svc:/system/name-service/upgrade:default

Import legacy configuration files into SMF service.

Sub Commands

The nscfg utility supports the subcommands described below. Options are described in the context of the subcommands.

import [–fvq] FMRI

If none of the SMF repository properties for the specified FMRI are currently populated, import the legacy configuration files associated with the specified FMRI into the SMF repository.

With –f, force the repopulation of the SMF repository with the legacy configuration, even if currently populated.

With –v, issue verbose progress messages during the requested operation. With –q, issue no error or other messages during the requested operation.

export [–vq] FMRI

Export the SMF configuration for the specified FMRI to legacy configuration files. This operation removes any existing affected legacy file(s) and generates new one(s) using the SMF configuration.

unconfig [–vq] FMRI

Unconfigure the SMF configuration for the specified FMRI. This operation resets the specified FMRI and any existing legacy file(s) to their initial unconfigured state.

With –v, issue verbose progress messages during the requested operation. With –q, issue no error or other messages during the requested operation.

validate [–vq] FMRI

Validate the SMF configuration for the specified FMRI. This operation checks the current configuration and verifies whether any errors exist.

With –v, issue verbose progress messages during the requested operation. With –q, issue no error or other messages during the requested operation.

Examples

Example 1 Importing DNS Client Configuration

The following command imports the DNS client configuration, stored in resolv.conf, into the SMF repository.

# nscfg import svc:/network/dns/client:default
Example 2 Exporting SMF LDAP Client Configuration

The following command exports the SMF LDAP client configuration to the legacy configuration files in /var/ldap.

# nscfg export svc:/network/ldap/client:default
Example 3 Resetting Name Service Switch Configuration

The following command resets the name service switch configuration to its initial unconfigured state. The command generates no output and exits quietly with status only.

# nscfg unconfig -q svc:/system/name-service/switch:default
Example 4 Validating LDAP Client Configuration

The following command validates the LDAP client configuration for errors or inconsistencies. The command generates no output and exits quietly with status only.

# nscfg validate -q svc:/network/ldap/client:default

Exit Status

0

Command successfully executed.

1

An error occurred.

2

Configuration unmodified, no change necessary.

3

No configuration to import.

Files

  • /etc/default/{nss, yppasswd}

  • /etc/defaultdomain

  • /etc/nscd.conf

  • /etc/nsswitch.conf

  • /etc/resolv.conf

  • /var/ldap/ldap_client_cred

  • /var/ldap/ldap_client_file

  • /var/yp/binding/{nisdomainname}/ypservers

  • /var/yp/NISLDAPmapping

  • /var/yp/securenets

  • /var/yp/updaters

Attributes

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Availability
system/core-os
Interface Stability
Uncommitted

See Also

svcs(1), defaultdomain(5), nsswitch.conf(5), resolv.conf(5), ypfiles(5), attributes(7), ldapclient(8), nscd(8), svcadm(8), svccfg(8), ypinit(8)