Operating System - HP-UX
1834449 Members
2459 Online
110067 Solutions
New Discussion

Re: NFS re-export in ServiceGuard

 
Jeff Carlin
Frequent Advisor

NFS re-export in ServiceGuard

I have more of a procedural question. We're running the NFS toolkit and have two NFS packages . One of the packages (developers) constantly needs changes and additions to the hanfs.sh file for the export options. I've been making these changes, syncing the files between nodes then failing the package to get the NFS re-exported. Is there a better way to re-export the NFS in place on that node? Something akin to the exportfs -a?
Where wisdom is called for, force is of little use. --Of course, a hammer does wonders for relieving stress.
2 REPLIES 2

Re: NFS re-export in ServiceGuard

Jeff,

You mean you're always changing the XFS[] entries in hanfs.sh?

If you look at the code in hanfs.sh you will see that all it does is:

exportfs -i XFS[n]

for whatever XFS entry it's dealing with.

So you can either just run this for each NFS mount you change/add, or even craft a short script which pulls the XFS entries out of hanfs.sh and re-runs exportfs -i on them.

I prefer the script option as its more likely to pick up any typos in your XFS entries so you don't get caught out next time you restart the package. Just remember to still update the other node as well (make it part of the script?

HTH

Duncan

I am an HPE Employee
Accept or Kudo
Olivier Masse
Honored Contributor

Re: NFS re-export in ServiceGuard

There is no magic solution (at least there wasn't last time I used hanfs two years ago). I never liked adding or removing exports once in production.

A safe but cumbersome way is to maintain both hanfs.sh as well as a static /etc/exports file which can be used to re-export everything. Or run exportfs manually when adding a new export. But this knowledge can be lost between admins. And be careful when editing hanfs.sh as well, as if there is a single typo in there, it might fail next time you run it months later.
Using your own variables directly in hanfs.sh or netgroups could help to make the syntax leaner, but they must be kept synchronized on all your nodes as well.

I did modify hanfs.sh in the old days and added an option to make dynamic exports, but I had to be very careful because if there was any error encountered while running the script, it went berzerk and unexported everything -- you don't want that to happen when you're live.

Olivier