12.07.2015 Views

Red Hat Enterprise Linux 5 Administration Unleashed

Red Hat Enterprise Linux 5 Administration Unleashed

Red Hat Enterprise Linux 5 Administration Unleashed

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Enabling NIS 265Because the lines that begin with # are comments, the auto.* files listed by default arenot built into NIS maps. They are just shown as examples of files that can be shared byNIS. Add auto.master and any other auto.* files being used by autofs at the end of thefirst line before the \ character.If you added any auto.* file variables in the first step and then added those files to theall target, you also need to add a target for each additional file. These individual targetsare near the end of the file such as the following:12auto.home: $(AUTO_HOME) $(YPDIR)/Makefile@echo “Updating $@...”-@sed -e “/^#/d” -e s/#.*$$// $(AUTO_HOME) | $(DBLOAD) \-i $(AUTO_HOME) -o $(YPMAPDIR)/$@ - $@-@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@Create a new stanza for each additional autofs file by copying this one and replacingauto.home with the name of the autofs file and AUTO_HOME with the name of the variableyou created in the first step. Be sure to use tabs instead of spaces to indent the lines oryou will receive a syntax error when reloading the autofs files.Reload the autofs files with the service autofs reload command as root. Or, if it is notalready started, execute service autofs start as root on the NIS server.To ensure autofs is started by boot time, execute chkconfig autofs on as root.In the /var/yp/ directory on the NIS server, type the make command as root to create NISmap files from the autofs files. Listing 12.2 shows the output of the make command afteradding auto.master and auto.home to the all target.LISTING 12.2Creating the autofs NIS mapgmake[1]: Entering directory `/var/yp/example’Updating passwd.byname...Updating passwd.byuid...Updating group.byname...Updating group.bygid...Updating hosts.byname...Updating hosts.byaddr...Updating rpc.byname...Updating rpc.bynumber...Updating services.byname...Updating services.byservicename...Updating netid.byname...Updating protocols.bynumber...Updating protocols.byname...Updating mail.aliases...Updating auto.master...Updating auto.home...gmake[1]: Leaving directory `/var/yp/example’

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!