On Tue, Jun 26, 2007 at 08:50:44PM +0200, Lars Marowsky-Bree wrote:
> On 2007-06-22T17:59:01, 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
>
> Hey David and Matthew, how portable is the above command to BSD et al?
uh, I just recognized it does not even make much sense on linux...
try with a postfix ...
the only output you will get are the _relative_ socket names,
there would be only "..... private/smtp".
fortunately most such programs would be catched by fuser,
because of their cwd being on the fs in question.
but just imagine (staying wiht postfix as the example)
you had $postfix_spool/private as a separate file system...
cwd is outside (it is $postfix_spool), socket is inside :->
we'd have to do tricks with
lsof -dcwd -U -F pn0 | perl -0 -e ' ... '
(btw, also of interesst may be /proc/net/unix)
or even worse, think of an evil proggie that did
bind somename
listen on that thing
chdir somewhere/else
there is still only "somename" in the socket struct, and that is the
only thing lsof (or any other tool) can find.
the lsof | perl contruct above would guess absolutely bogus full pathes.
and what about named unix domain sockets,
that have been unlinked later on (a normal usage pattern)?
do they hold a file system reference?
how would we catch those?
so this is no catch all.
it "only" happens to find a couple more corner cases...
aparently there is currently no way to reliably
map named unix domain sockets back to full path.
maybe we just forget about it,
and live with the (more or less hard!)
reboot in case this triggers?
:(
--
: 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/