From owner-freebsd-arch@FreeBSD.ORG Thu Jan 19 13:50:54 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 0D6DF106564A; Thu, 19 Jan 2012 13:50:54 +0000 (UTC) (envelope-from listlog2011@gmail.com) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id CC3638FC13; Thu, 19 Jan 2012 13:50:53 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q0JDopOB034080; Thu, 19 Jan 2012 13:50:51 GMT (envelope-from listlog2011@gmail.com) Message-ID: <4F181FBB.4060104@gmail.com> Date: Thu, 19 Jan 2012 21:50:51 +0800 From: David Xu User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: Jos Backus References: <4F14E291.5090803@FreeBSD.org> <86mx9msog3.fsf@ds4.des.no> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Cc: =?ISO-8859-1?Q?Dag-Erling_Sm=F8rgrav?= , 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 Reply-To: davidxu@freebsd.org List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2012 13:50:54 -0000 On 2012/1/18 5:47, Jos Backus wrote: > 2012/1/17 Dag-Erling Smørgrav > >> Jos Backus writes: >>> If FreeBSD had a solid solution out of the box, all this pidfile hackery >> in >>> the base system wouldn't be necessary. I always thought FreeBSD was about >>> good engineering. Perpetuating the pidfile mess in the base is not a sign >>> 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 > This sounds like a very cool tool, looks like these ideas are widely adopted, I found some of the concepts are also in erlang OTP. ;-) Regards, David Xu