From owner-freebsd-arch@FreeBSD.ORG Tue Jan 17 21:47:22 2012 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0EE8106566B; Tue, 17 Jan 2012 21:47:22 +0000 (UTC) (envelope-from jos@catnook.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id 82AC18FC1E; Tue, 17 Jan 2012 21:47:22 +0000 (UTC) Received: by ggki1 with SMTP id i1so4440328ggk.13 for ; Tue, 17 Jan 2012 13:47:21 -0800 (PST) MIME-Version: 1.0 Received: by 10.50.195.129 with SMTP id ie1mr19179190igc.29.1326836841660; Tue, 17 Jan 2012 13:47:21 -0800 (PST) Received: by 10.42.140.196 with HTTP; Tue, 17 Jan 2012 13:47:21 -0800 (PST) In-Reply-To: <86mx9msog3.fsf@ds4.des.no> References: <4F14E291.5090803@FreeBSD.org> <86mx9msog3.fsf@ds4.des.no> Date: Tue, 17 Jan 2012 13:47:21 -0800 Message-ID: From: Jos Backus To: =?ISO-8859-1?Q?Dag=2DErling_Sm=F8rgrav?= Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Doug Barton , freebsd-arch@freebsd.org Subject: Re: Importing djb's public domain daemontools? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 21:47:22 -0000 2012/1/17 Dag-Erling Sm=F8rgrav > Jos Backus writes: > > If FreeBSD had a solid solution out of the box, all this pidfile hacker= y > in > > the base system wouldn't be necessary. I always thought FreeBSD was abo= ut > > good engineering. Perpetuating the pidfile mess in the base is not a si= gn > > of good engineering. > > Software written by DJB hardly qualifies as "good engineering". PID > files are well-known and well-tested, we have a solid implementation > with a simple API (pidfile(3)), and a lot of our infrastructure depends > on them (/etc/rc, newsyslog etc.) > Just because lots of people have been doing something for a long time that is widely supported, doesn't mean it's the right thing to do. As I said before, pidfiles export partial information that is already available in the process table, without requiring extra cached file system copies that need to be created/removed, have their permissions managed carefully and can get stale. daemontools is one implementation that solves the same problem without using pidfiles. It also gives you the option of a well-defined startup environment for each service (not tied to the environment of the caller) and the ability to add fine-grained control over a service (by manipulating the permissions on the control socket, so select non-root users can start root services if desired). It also comes with built-in logging (multilog). Additionally, using the finish script functionality, policies around crashes can be instituted (e.g. down the service and send an alert if it crashes more than N times within M minutes). These are just some of the features that I have used in the past to run services on hundreds of machines in multiple data centers. daemontools is surprisingly flexible, and it doesn't require complex configuration commands or configuration files - a boon when used in combination with tools like Puppet. That said, I don't care what we pick as long as we pick something that can do all the above. Jos > DES > -- > Dag-Erling Sm=F8rgrav - des@des.no > --=20 Jos Backus jos at catnook.com