SUMMARY: choosing the number of nsfd processes

From: Lenny Turetsky (lturetsk@econ.yale.edu)
Date: Fri Jan 13 1995 - 23:50:30 CST


Well, the first response had a useable answer, so here it is:

---------- Forwarded message ----------
Date: Fri, 13 Jan 95 17:52:53 +0100
From: Jochen Bern <bern@penthesilea.uni-trier.de>
Subject: Re: choosing the number of nsfd processes

> > My question is whether there is any way to have a machine figure out
> > its number of exported disks in it's rc.local?

> > Figuring out the number of exported FSs is easy (wc -l <
> > /etc/exports), but the number of disks is a bit more difficult.
> [Bzzzzzt] You can export several Dir Trees from one FS. ;-)

Whoops! Mr. Bern is correct. What I meant to say was that figuring out
the number of exports (not exported FSes) is easy.

> > Has anyone devised a creative way of determining this? Mr. Stern?
> df `exportfs|sed -e 's/ .*//'`|grep '^/dev/'|sed -e 's/.* //'|sort -u|wc -l

This works. However (minor stuff):
        I'm not sure that the "sed -e 's/ .*//'" is perfectly correct.
                sed 's/-.*$//' seems better to me (what if a dirname
                has a space in it?).
        I also don't think that the grep for '^/dev/' is needed (you
                can only export local filesystems, right?) -- tail +2
                does the trick of removing the df heading.

I think the following may be a bit better (or, at least, cleaner):
        df `exportfs | sed 's/ -.*$//'` | tail +2 | sort -u | wc -l

> (You'll want to add Spaces around the '|', I trimmed them to shorten
> the Line for Mail)

Well, the cleaned up version was shorter, so I left the spaces in. ;->

All criticism aside (it was just minor stuff), Mr. Bern's solution is
very good, and I owe him my gratitude.

LT

 ,-----------------------------------------------------.
 | Yale Economics Dep't | Lenny Turetsky |
 | System Administrator | lturetsk@econ.yale.edu |
 |-------------------------+---------------------------|
 | My employers paid for some of my time and energy. |
 | My opinions were never for sale. |
 `-----------------------------------------------------'



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:10:14 CDT