From owner-freebsd-arch@FreeBSD.ORG Sun Aug 4 16:49:56 2013 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 356FDB3F; Sun, 4 Aug 2013 16:49:56 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EF2E82F69; Sun, 4 Aug 2013 16:49:55 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id A81FE3592EA; Sun, 4 Aug 2013 18:49:54 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 835A028494; Sun, 4 Aug 2013 18:49:54 +0200 (CEST) Date: Sun, 4 Aug 2013 18:49:54 +0200 From: Jilles Tjoelker To: Tom Rhodes Subject: Re: Reliable process tracking Message-ID: <20130804164954.GA37887@stack.nl> References: <20130804134658.GC35080@stack.nl> <20130804102708.36341a8a.trhodes@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130804102708.36341a8a.trhodes@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-arch@freebsd.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Aug 2013 16:49:56 -0000 On Sun, Aug 04, 2013 at 10:27:08AM -0400, Tom Rhodes wrote: > On Sun, 4 Aug 2013 15:46:58 +0200 > Jilles Tjoelker wrote: > > When shutting down a service or requesting status, rc.subr currently > > uses a combination of pidfiles and process names. This is fairly but not > > completely reliable once it is set up correctly (which can take a lot of > > work and possibly patching the daemon to use pidfile(3) from our > > libutil). It is also incapable of killing multiprocess daemons such as > > CGI web servers without cooperation of the daemon. > > I think what is needed here is a facility that marks a process and all > > of its descendants. Removing the mark should be a privileged or at least > > an unusual operation; no unprivileged function specified by POSIX such > > as setsid() should do this. > > [snip] > > Similar facilities in other operating systems: Linux cgroups, Solaris > > process contracts. > There is fscd - it does a lot of what you ask for. In fact, I had > talked to a few people about bringing it into base but have not > really figured out how I want to integrate it into rc. I think fscd complements reliable process tracking; it does not provide it. Fscd relies on rc.d's status, stop and restart to work and therefore only works properly if those work properly. -- Jilles Tjoelker