old dhcpcd problem revisited

DJ Lucas dj at lucasit.com
Tue Apr 29 10:50:12 PDT 2003

DJ Lucas wrote:
> Michael A. Peters wrote:
>> I guess what I'm saying is that the mountfs init really should only
>> pertain to local file systems (ESPECIALLY if your nfs support is
>> modular) and that nfs file systems should be handled with it's own init
>> script (that starts in 3,4,5 and goes down in 0,1,2,6)
> Yes..correct, mountfs should only pertain to local filesystems, and that 
>  The solution, as I see it, is a "mini sendsignals" in the
> begining of the stop section of the netfs script.  This should source 
> /etc/mtab or /proc/mounts, and use /sbin/fuser (IIRC) to check only 
> filesystems that are mounted with fstypes of nfs, smbfs, and whatever 
> the others are.  Then issue kills specifically for any pids found that 
> have these locks, so we can then get a clean umount when the rest of the 
> script runs for netfs's.  

I browsed around on the net a bit today for ideas...  eventually found 
the fuser man page http://www.mcsr.olemiss.edu/cgi-bin/man-cgi?fuser+1 .

Looks like the easiest method for this is to recomend that a special 
subdir be created for network mounts, such as /mnt/netfs/ and that mount 
points be created in that directory, so as not to have to source the 
/etc/mtab at all.  Then 'fuser -c /mnt/netfs/*' should give the pids of 
any processes using any files deeper than /mnt/netfs/.  I'm not sure 
about the syntax however...just an initial thought, a 'for in do' loop 
may be needed there.  Also...a long time ago, somebody suggested lsof 
for this..looks like "lsof +D '/mnt/netfs/'". 

I still have to build a new box again....been messin with plfs scripting 
and some vpn things (at the same time...I need more boxes to play with I 
think)...not actually keeping my builds around at all, just been working 
off of super rescue (RH Based CD Distro) and winblows.

Asuming one of the above is correct, next step is to stip the output of 
fuser to get just the PIDs (get rid of the letter codes following the 
pids) or use lsof, and then throw that output at killproc.  Damn that 
sounds really dangerous...no more destructive than the real 
sendsignals...but it still sounds really bad.  Needless to say..we 
really need to run 'netfs stop', 'network stop', 'sendsignals', and 
'mountfs stop', right together in that order in rl0 an rl6.  rl1 and rl2 
get this stop script just before network...may need to put some 
failsafes in there for certain predetermined pid's  (and a ton of comments).

Oh well, just sharing thoughts,


Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe blfs-dev' in the subject header of the message

More information about the blfs-dev mailing list