From owner-freebsd-questions@FreeBSD.ORG Mon May 16 19:56:32 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8BF3D16A4CE for ; Mon, 16 May 2005 19:56:32 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.201]) by mx1.FreeBSD.org (Postfix) with ESMTP id E828D43DA2 for ; Mon, 16 May 2005 19:56:31 +0000 (GMT) (envelope-from christopher.hodgins@gmail.com) Received: by wproxy.gmail.com with SMTP id 69so1693852wra for ; Mon, 16 May 2005 12:56:30 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=PFI+865XCtV1JqbclZfumMi3i0fRnhu6C2m1gIeZQVSIsmTYcFz6NFjfiCxDOK5HxMmOrJVh7PltR1XCdugVu57cKpihEOCusKykeMEumKZfio1nqIDnzp6TGahlUK3kf4EtagqRkV6NAUuRDyHRAY9k5Pol/19J3VBasvd7IHU= Received: by 10.54.41.78 with SMTP id o78mr3860610wro; Mon, 16 May 2005 12:56:30 -0700 (PDT) Received: by 10.54.82.6 with HTTP; Mon, 16 May 2005 12:56:30 -0700 (PDT) Message-ID: <63c3899e050516125654d2d497@mail.gmail.com> Date: Mon, 16 May 2005 20:56:30 +0100 From: Chris Hodgins To: Giorgos Keramidas In-Reply-To: <20050516185231.GC702@orion.daedalusnetworks.priv> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <2ab1ba0c05051608414c0884c7@mail.gmail.com> <1639417618.20050516184834@ramb.com.ua> <20050516185231.GC702@orion.daedalusnetworks.priv> cc: Gowtham cc: "Sergey S. Ropchan" cc: freebsd-questions@freebsd.org Subject: Re: Daemon Process X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Chris Hodgins List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2005 19:56:32 -0000 On 5/16/05, Giorgos Keramidas wrote: > On 2005-05-16 18:48, "Sergey S. Ropchan" 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