relating NetInfo to classic UNIX

NetInfo, NeXT's network administration system, supersedes many of the UNIX flat-file databases. NetInfo offers convenient mechanisms for loading and extracting data that it stores in traditional UNIX flat-file database format.

There are three general means of examining and modifying the NetInfo databases:

·	Manager applications-UserManager and NetManager, for example, provide a high-level interface to data stored in NetInfo.
·	Database editors-NetInfoManager and the UNIX niutil command let you directly modify directories, properties, and values.
·	UNIX format tools-the UNIX niload and nidump commands convert between UNIX flat files and NetInfo.

For more information on the UNIX commands see the on-line UNIX manual pages of the Extended release. The NeXTstepâ applications are documented in the NeXT Network and System Administration manual. (Note that the nidomain command is not described in this article.)

information superseded by NetInfo
Almost all of the "classic" UNIX flat-file information that is properly shared among machines is superseded by the NetInfo database. Some of what seems to be purely local configuration information is in fact network-related. For example

·	The UNIX file /etc/hosts is superseded by the host name database in the /machines NetInfo directory. 

·	The UNIX file /etc/printcap is superseded by the available printer database in the NetInfo /printers directory.

Modifying any of the UNIX files superseded by the NetInfo database has no effect on the information in the database. To modify the database, you must use one of the manager applications, one of the database editors, or the niload command.

using formats with niload and nidump
When using the UNIX format tools, you need to specify a format for the information you want to extract or load. There are a number of formats, each corresponding to an identically named UNIX flat file. These formats, along with the UNIX directory in which the flat file resides and the NetInfo directory with the corresponding information, are shown in table 1.

table 1: NetInfo UNIX formats

format and file	UNIX directory	Netinfo directory
aliases	/private/etc/sendmail	/aliases
bootptab	/private/etc	/machines
bootparams	/private/etc	/machines
fstab	/private/etc	/mounts
group	/private/etc	/groups
hosts	/private/etc	/machines
networks	/private/etc	/networks
passwd	/private/etc	/users
printcap	/private/etc	/printers
protocols	/private/etc	/protocols
rpc	/private/etc	/rpcs
services	/private/etc	/services

/machines formats
Three formats are used to extract information from the /machines directory: hosts, bootptab, and bootparams. None of these formats extracts or loads the serves property's values. Use hosts to load and dump the following properties in a format suitable for use in 
/private/etc/hosts:

·	name (the machine's host name)

·	ip_address (Internet address)

Use bootptab to load and dump the following properties in a format compatible with /private/etc/bootptab:

·	name

·	en_address (Ethernet address)

·	ip_address (Internet address)

·	bootfile (netboot kernel)

In this case, the file produced by nidump and used by niload can be 
/private/etc/bootptab. The information in that file other than the per-host fields (for example, the name of the default kernel) is included by nidump and ignored by niload.

Use bootparams to load and dump the following information in a format compatible with /private/etc/bootparams:

·	name

·	bootparams (netboot file system information)

All values of the bootparams property are dumped and loaded even though only the root= and private= portions of the bootparams property's values are used in a typical NeXT netbooting environment.

user-related formats
Three formats are used to dump and load user information: passwd, group, and aliases. 

Use the passwd format to access the following /users properties:

·	name (login name)

·	passwd (encrypted password)

·	uid (user's numeric user ID)

·	gid (user's home group number)

·	realname (comment, usually the user's actual name)

·	home (home directory)

·	shell (default shell)

The properties accessed in /groups by the group format are as follows: 

·	name (group name)

·	passwd (encrypted password, usually not used and simply *)

·	gid (numeric group ID)

·	users (list of the members of the group)

Note that niload does not check the consistency of the input file for groups, and a malformed input file can produce unpredictable results.

The properties accessed in /aliases by the aliases format are as follows:

·	name (name of the alias)

·	members (those in the mailing list)

Any custom properties you might have added in /users, /groups, and /aliases will not be extracted and cannot be loaded with niload.

file systems (/mounts) formats
The /private/etc/fstab file is consulted during system boot before NetInfo and the rest of the networking subsystem are started. This allows you to mount any local disks early in the boot process. Once the network and NetInfo are started, /private/etc/fstab is ignored: all network mounts, for example, will come from NetInfo.

Use the fstab format to dump and load the following properties from the /mounts directory:

·	name (name of the file system)

·	dir (local mount point)

·	type (file system type)

·	opts (options to the mount command)

·	freq (frequency for the dump command)

·	passno (pass number for concurrently running fsck)

The freq and passno properties are irrelevant for remote file systems. If you don't specify the file system type when using nidump, nidump assumes the value nfs.

printer (/printcap) format
The printcap format can access very many properties. Unlike the other formats described so far, printcap is rather open-ended: nonstandard printer properties are both loaded and dumped. Comments-such as an indication of the printer's location or the date the toner cartridge was last changed-will be read and written. For an example, see figure 1.

¬

In addition to the properties described in the printcap entry in the UNIX manual pages, NeXT supports (and various software uses) other properties, including the following:

·	BannerBefore and BannerAfter (control printing a banner page)

·	note (comment shown in Print panels)

·	sharedTo and sharedAs (describe the domain to which the printer is shared and the printer's public name)

·	RemoteAsNobody (indicates that you should run remote print jobs as an unprivileged user)

adding machines to network groups
Network groups (or netgroups) are a mechanism introduced by NIS (Network Information Service) to allow you to refer to groups of machines, users, and NIS domains. NetInfo supports only the machine-related aspects of netgroups. The aspects of netgroups related to users and NIS domains are available only when you are using NIS.

You can add a machine to a netgroup by including the name of the network group as one of the values of the netgroups property in the /machines directory. Because there are no nidump and niload formats available for accessing the netgroups property, you have to add it and appropriate values using either NetInfoManager or niutil. Figure 2 shows the netgroups property in NetInfoManager.

¬

networking formats
The properties and formats related to other networking issues are shown in table 2. 

table 2: networking formats

format	properties accessed
networks	name, address
protocols	name, number
rpc	name, number
services	name, port, protocol

information used from UNIX files
Not all the administrative information in UNIX files is superseded by NetInfo. Much of the information that is not superseded is specific to a given machine. This makes sense because NetInfo is geared around network-wide administrative data.

The following UNIX files are referenced for administrative information even when NetInfo is running. All of these files are in /private/etc.

·	crontab and crontab.local

·	disktab

·	gettytab

·	inetd.conf

·	exports

·	remote

·	resolv.conf and the Domain Name Service (DNS, also known as BIND) database

·	swaptab

·	syslog.conf

·	termcap

·	ttys

In addition, the UUCP facility's configuration files (in /private/etc/uucp) are referenced and are not stored in NetInfo. The same is true for /private/etc/sendmail/sendmail.cf, sendmail's configuration file.

One other note on a related topic: If you check the UNIX manual page for syslogd, you'll notice a facility for sending log messages to another machine. Syslogd is started before NetInfo, so any machines named for this use in syslog.conf must be defined in the /private/etc/hosts flat file, or syslogd will be unable to resolve the host name.

NetInfo, NIS, and DNS
How does the system access the non-NetInfo sources of administrative information on a NeXT computer? There are two distinct sets of information: mail addresses and everything else.

For everything except mail addresses, NetInfo is consulted first, then the DNS is consulted (if it's being used and is appropriate for the information being requested), and finally NIS is consulted. The UNIX flat files are consulted only when needed by NIS, according to the normal NIS semantics.

For mail addresses, the application sending the mail first looks in the sender's private aliases databases. The message is then forwarded to sendmail, which checks in NetInfo, then in NIS, and finally in the appropriate UNIX flat file (/private/etc/sendmail/aliases by default). Only local addresses are subject to alias resolution. If an address is remote, a search is made of the DNS's Mail Exchanger (MX) records. If one is found for the target machine, the message is sent to the MX-specified mail exchanger rather than to the machine stated in the address.