get pid of locking process

DJ Lucas dj_me at swbell.net
Sun Nov 10 12:44:58 PST 2002


Hello,

How would one go about finding out what process has a device in use and 
get the PID for a kill?  As a for-instance:

root at Name2:root# umount /mnt/lfs/usr
umount: /mnt/lfs/usr: device or resource busy
root at Name2:root#

For those curious as to why I'd like to do this, it's for my little 
problem with 'network stop' running before sendsignals and the 
possibility of a program still needing access to the network mounted 
drives.  Although I've not yet actually seen this issue, I'm attempting 
to work around it before I ever do.  Basically... K44umntnetfs, 
K45network, K50sendsignals, K55mountfs....  Could be used in blfs book 
maybe or maybe not..it's the only clean solution I can think of.
While I'm at it, a recap of that problem, in case anybody has a better 
Idea:  dhcpcd (dhcp client) is killed by sendsignals before network 
filesystems have a chance to be unmounted.  The mountfs script needs to 
be run after sendsignals, as sendsignals is the last shot effort to kill 
everything that needs to be down before the filesystems are unmounted. 
However if network is run after sendsignals, then the network is already 
down and thus mountfs can/might not be able to cleanly unmount the 
network filesystems.  I can't personally think of a better way to attack 
this problem, but with basically a sendsignals for the network and then 
unmounting the network drives in the same script (right before 
sendsignals anyways.  I'm of course open to other suggestions, however 
I'd still like a pointer in the direction of the first question...seems 
I'd need to know this anyways. ;-)

Thanks in advance for any help,

DJ Lucas

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



More information about the blfs-support mailing list