Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 May 2005 20:56:30 +0100
From:      Chris Hodgins <christopher.hodgins@gmail.com>
To:        Giorgos Keramidas <keramida@ceid.upatras.gr>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Daemon Process
Message-ID:  <63c3899e050516125654d2d497@mail.gmail.com>
In-Reply-To: <20050516185231.GC702@orion.daedalusnetworks.priv>
References:  <2ab1ba0c05051608414c0884c7@mail.gmail.com> <1639417618.20050516184834@ramb.com.ua> <20050516185231.GC702@orion.daedalusnetworks.priv>

next in thread | previous in thread | raw e-mail | index | archive | help
On 5/16/05, Giorgos Keramidas <keramida@ceid.upatras.gr> wrote:
> On 2005-05-16 18:48, "Sergey S. Ropchan" <fenix@ramb.com.ua> wrote:
> > Monday, May 16, 2005, 6:41:03 PM, you wrote:
> > > Hi,
> > > I want to know how can I programmatically restart a dead daemon
> > > process in Unix?
> >
> > You can restart daemon process with:
> >
> > kill -HUP `cat /path/to/processname.pid`
>=20
> Note the daemon is 'dead'.  You can't signal a dead process.
>=20

Hehe.  Perhaps what you want is a cron job that runs a shell script
every 5 mins or so.  The shell script can check for the pid file and
if it does not exist then it restarts the daemon.  If it does find the
pid file then it will probably want to then check if the daemon is
running or not, just incase it died and never cleaned up.  Again if no
process with that pid exists it can restart the daemon.  There are
probably better ways but this is pretty simple.

Chris



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?63c3899e050516125654d2d497>