On Tue, 26 Jun 2007, 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?

"lsof" isn't native to Solaris, not even at its (current) "Solaris 10"
release.

Judging by the BSD man pages, its native availability there seems patchy.


So could I suggest, if reasonably possible, code of the form:

   if [ -x @LSOF@ ]
   then
      ... @LSOF ...
   else
      ... @FUSER@ ...
   fi

recognising that some sort of additional error-handling for the @FUSER@
case might be necessary?

Need the absence of "lsof" be a show-stopper, so long as "fuser" is
present?



Incidentally I recommend the man-page site:
    http://www.freebsd.org/cgi/man.cgi?

It allows you to see man pages for various versions of various OSes, not
just BSD, but Solaris, Linux flavours, HPUX, ...  Well worth bookmarking.


-- 

:  David Lee                                I.T. Service          :
:  Senior Systems Programmer                Computer Centre       :
:  UNIX Team Leader                         Durham University     :
:                                           South Road            :
:  http://www.dur.ac.uk/t.d.lee/            Durham DH1 3LE        :
:  Phone: +44 191 334 2752                  U.K.                  :
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Reply via email to