monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [NFS] monit NFS process


From: Christian Hopp
Subject: Re: [NFS] monit NFS process
Date: Mon, 26 Aug 2002 13:46:37 +0200 (CEST)

On Mon, 26 Aug 2002, Izquierdo, Raul wrote:

>       Ok, this is the port used by nfs, but monit needs a pidfile to
> monitorize any process. In this case, I think that nfs doesn't create a
> pidfile when it starts. I'm using redHat 7.2. I've seen in FAQ that I can
> start any process using "echo $$ > /tmp/program.pid" before executing the
> comand, but I'd like to know if exists another way to do it.

You have the PID in $! after starting it, thus

echo $! > /var/run/nfsd.pid

directly after the call of nfsd would do it.

Or a pgrep  would do it too,

pgrep -P 1 -u 0 '^nfsd$' > /var/run/nfsd.pid

would get the nfsd owned by root with init as parent.

Or you can replace the start up by

pgrep -P 1 -u 0 '^nfsd$' || /whereever/nfsd -whatever && \
   pgrep -P 1 -u 0 '^nfsd$' > /var/run/nfsd.pid

thus nfsd is only started if nfsd is not running yet.

C.Hopp

-- 
Christian Hopp                                email: address@hidden
Institut für Elektrische Informationstechnik             fon: +49-5323-72-2113
Technische Universität Clausthal                         fax: +49-5323-72-3197
  pgpkey: https://www.iei.tu-clausthal.de/pgp-keys/chopp.key.asc  (2001-11-22)






reply via email to

[Prev in Thread] Current Thread [Next in Thread]