Operating System - HP-UX
1826605 Members
3204 Online
109695 Solutions
New Discussion

Re: NIS Migration - Problem with auto.export

 
Manoj Sivan
Regular Advisor

NIS Migration - Problem with auto.export

Hi,

I am on the way of migrating NIS user from one NIS server to another. The usrer which i am migrating are having their home directory in the old NIS server which dont have home directory exported from their workstation.I would like to continue using that home directory of the old NIS server. The directory is exported and i am able to mount it through fstab.


I tried to add the following lines in the new servers Makefile for mapping of those directories.
====================================================================================================
$(YPDBDIR)/$(DOM)/auto_export.time: $(DIR)/auto_export
@(sed -e "s/^[ | ]*//g" -e "/^#/d" -e s/#.*$$// < $(DIR)/auto_export $(CHKPIPE))| \
$(MAKEDBM) - $(YPDBDIR)/$(DOM)/auto.export;
@touch $(YPDBDIR)/$(DOM)/auto_export.time;
@echo "updated auto.export";
@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOM) auto.export; fi
@if [ ! $(NOPUSH) ]; then echo "pushed auto.export"; fi

$(YPDBDIR)/$(DOM)/auto_Direct.time: $(DIR)/auto_Direct
@(sed -e "s/^[ | ]*//g" -e "/^#/d" -e s/#.*$$// < $(DIR)/auto_Direct $(CHKPIPE))| \
$(MAKEDBM) - $(YPDBDIR)/$(DOM)/auto.Direct;
@touch $(YPDBDIR)/$(DOM)/auto_Direct.time;
@echo "updated auto.Direct";
@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOM) auto.Direct; fi
@if [ ! $(NOPUSH) ]; then echo "pushed auto.Direct"; fi
====================================================================================================
auto.export:
@if [ ! $(NOPUSH) ]; then $(MAKE) $(MFLAGS) -k \
$(YPDBDIR)/$(DOM)/auto_export.time DOM=$(DOM) DIR=$(DIR); \
else $(MAKE) $(MFLAGS) -k $(YPDBDIR)/$(DOM)/auto_export.time \
DOM=$(DOM) DIR=$(DIR) NOPUSH=$(NOPUSH);fi
auto.Direct:
@if [ ! $(NOPUSH) ]; then $(MAKE) $(MFLAGS) -k \
$(YPDBDIR)/$(DOM)/auto_Direct.time DOM=$(DOM) DIR=$(DIR); \
else $(MAKE) $(MFLAGS) -k $(YPDBDIR)/$(DOM)/auto_Direct.time \
DOM=$(DOM) DIR=$(DIR) NOPUSH=$(NOPUSH);fi
====================================================================================================

and when do a make at /var/yp i am getting following error.


Bad character | (octal 174), line 239Make: . Stop.

(line 239 is : $(MAKEDBM) - $(YPDBDIR)/$(DOM)/auto.export;)

So kindly guide me, whether i am doing any wrong step. What i have done so far is to replicate the entries in the passwd, group, auto_user, netgroup entries domainypsrc directory.

Waiting for the expert comments.

With Regards

manoj
5 REPLIES 5
Peter Nikitka
Honored Contributor

Re: NIS Migration - Problem with auto.export

Hi,

if I compare this against similar entries in my Makefile, I see this difference:
Yours:
@(sed -e "s/^[ | ]*//g" -e "/^#/d" -e s/#.*$$// < $(DIR)/auto_export $(CHKPIPE))| \
$(MAKEDBM) - $(YPDBDIR)/$(DOM)/auto.export;

Mine:
@(sed -e "s/^[ | ]*//g" -e "/^#/d" -e s/#.*$$// < $(DIR)/auto_export $(CHKPIPE)) \
| $(MAKEDBM) - $(YPDBDIR)/$(DOM)/auto.export;


Nevertheless the first one seems syntactically correct as well for the Posix shell. If you have a
SHELL = ..
line in your Makefiles, check for its value.

mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
Manoj Sivan
Regular Advisor

Re: NIS Migration - Problem with auto.export

Hi,

I verified the variables in the Makefile and seems no SHELL variable set.

#DIR =/etc
DIR =/var/yp/sgp-nis_maps
DOM = `domainname`
NOPUSH = ""
ALIASES = /etc/mail/aliases
YPDIR=/usr/sbin
YPDBDIR=/var/yp
YPPUSH=$(YPDIR)/yppush
MAKEDBM=$(YPDIR)/makedbm
REVNETGROUP=$(YPDIR)/revnetgroup
STDETHERS=$(YPDIR)/stdethers
STDHOSTS=$(YPDIR)/stdhosts
MKNETID=$(YPDIR)/mknetid
MKALIAS=$(YPDIR)/mkalias
PWFILE=$(DIR)/passwd

Also tried to match the with your setup. Unfortunately same error. Is anything additionaly i need to set since auto.export was not there in the new NIS Makefile.

Regards

Manoj
Peter Nikitka
Honored Contributor

Re: NIS Migration - Problem with auto.export

Hi,

a simple question: is your makefile really correcttly formatted for make syntax?
The first character in a make rules has to be a character:
@if [ ! $(NOPUSH) ]; then $(MAKE) $(MFLAGS) ...
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
Manoj Sivan
Regular Advisor

Re: NIS Migration - Problem with auto.export

Hi Peter,

Yes it is with Tab. Attaching my Makefile.

Regards

Manoj
Peter Nikitka
Honored Contributor

Re: NIS Migration - Problem with auto.export

Hi,

I don't think, that the makefile format is correct:
The file in the attachment does NOT have a as the first character in the make rule for auto_export.time .
Other makerules do not have this was well!

Check again, correct this and the makefile will work.

mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"