[comp.sys.next] Makefile for niload

carlson@mrcnext.cso.uiuc.edu (06/25/89)

I find it much easier to edit the text files in /etc, than
mess around with the NetInfo App, especially since I do much of my
work remotely (like now).  This requires the frequent use of niload.

To make this easier, I made the file /etc/Makefile (below).
"make niload" will load any changed files (except passwd) after editing.
I hope someone else finds this useful.

------------ Cut Here ------------
NIDB=/etc/netinfo/local.nidb/touch
NILOAD=niload $? . < $?

help:
	@echo "After changing system tables (e.g. hosts), make niload"

niload: $(NIDB)
	touch $(NIDB)

# each dependency MUST have a separate line.
# note double colons

# People stuff
# nu(1) handles normal updates
pw:	
	niload passwd . < passwd
$(NIDB):: group; $(NILOAD)

# Unix device support
$(NIDB):: fstab; $(NILOAD)	# mounts
$(NIDB):: printcap; $(NILOAD)

# network services support
$(NIDB):: hosts; $(NILOAD)	# Only during boot; then use DNS
# network(5): no RIP server or routed
$(NIDB):: protocols; $(NILOAD)
$(NIDB):: services; $(NILOAD)
$(NIDB):: rpc; $(NILOAD)
--------------------
Brad Carlson  <carlson@mrcnext.cso.uiuc.edu> or <b-carlson@uiuc.edu>
University of Illinos--Micro Resource Center--NeXT guru 

ric@arizona.edu (Ric Anderson) (06/26/89)

In article <800013@mrcnext.cso.uiuc.edu>, carlson@mrcnext.cso.uiuc.edu writes:
> 
> I find it much easier to edit the text files in /etc, than
> mess around with the NetInfo App, especially since I do much of my
> work remotely (like now).  This requires the frequent use of niload.
> 
<stuff deleted>

I share Brad's feelings on editing the files in /etc.  BUT, be very
careful when you delete items or change existing ones.  Niload 
inclusive OR's each input file with the existing database.  This
means you must use
	niutil -destroy . /user/xxx
to delete user accounts you have removed from /etc/passwd with vipw.
Similarly, you have to use niutil to clean out things in the
machines (niload hosts) database if a host is removed from the net, or
gets a name change.  Ditto groups, fstab,...

Ric

Ric Anderson			Bitnet: Ric@Arizrvax
Member of the Technical Staff	Internet: ric@cs.arizona.edu
University of Arizona           AT&T: (602) 621-4048
Department of Computer Science
Gould-Simpson Room 721
Tucson, Arizona 85721