On Fri, Jun 22, 2007 at 05:32:32PM +0200, Lars Marowsky-Bree wrote:
> On 2007-06-22T14:33:34, Lars Ellenberg <[EMAIL PROTECTED]> wrote:
>
> > so we may want to complement the "$FUSER -a -k -v -m" with
> > something like
> > lsof -U | awk '/ \/'"$mountpoint"'\// { print $2 }' | xargs -- kill
> >
> > comments?
>
> Clearly correct. Thanks for pointing that out, and I've got to admit I
> missed that.
>
> Why complement though - doesn't lsof actually implement more than fuser?
yes, lsof is a superset of fuser and some other tools.
the equivalent of fuser -k -v -m is probably
lsof -t $mountpoint | xargs -- kill
but that misses out on the sockets as well,
so you still need the extra "lsof -U".
I found the many options to lsof slightly confusing. there may well be
a way to combine looking for open files and cwd AND sockets in one go.
(it may even be portable?)
maybe one could do just "lsof" and grep the output for the mountpoint...
but careful to not grep the wrong things by accident :)
(if you have many processes and open files, don't forget to set
LANG=C LC_ALL=C before you grep, or it will take ten times as long)
--
: Lars Ellenberg Tel +43-1-8178292-0 :
: LINBIT Information Technologies GmbH Fax +43-1-8178292-82 :
: Vivenotgasse 48, A-1120 Vienna/Europe http://www.linbit.com :
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/