From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/1048 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Re: Vision for new platform Date: Sun, 10 Jun 2012 09:22:46 -0400 Message-ID: <20120610132246.GF163@brightrain.aerifal.cx> References: <20120518010620.GW163@brightrain.aerifal.cx> <20120609192756.6e72f25e@sibserver.ru> <20120609074426.496a5e13@newbook> <20120609212411.GA163@brightrain.aerifal.cx> <87lijwnmao.fsf@gmail.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1339334840 7455 80.91.229.3 (10 Jun 2012 13:27:20 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 10 Jun 2012 13:27:20 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-1049-gllmg-musl=m.gmane.org@lists.openwall.com Sun Jun 10 15:27:19 2012 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1SdiAp-0008EY-8s for gllmg-musl@plane.gmane.org; Sun, 10 Jun 2012 15:27:19 +0200 Original-Received: (qmail 3134 invoked by uid 550); 10 Jun 2012 13:27:19 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 3126 invoked from network); 10 Jun 2012 13:27:18 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:1048 Archived-At: On Sun, Jun 10, 2012 at 02:53:49PM +0200, Daniel Cegiełka wrote: > 2012/6/10 Christian Neukirchen : > > Rich Felker writes: > > > >> A much better approach for systems that need automatic > >> stopping and starting of daemons would be to have a tiny > >> daemon-supervisor process to handle it; small systems with a very > >> "hands-on" admin not wanting to automate this could then skip the > >> supervisor daemon and start/stop manually. > > > > This is exactly what daemontools and variants do, with minimal code: > > http://cr.yp.to/daemontools.html > > http://offog.org/code/freedt.html > > > Chapter 4.1.1 Introducing procer: > http://mongrel2.org/static/book-finalch5.html Judging from its criticisms of daemontools, I suspect it might be just as broken as all the traditional script/pidfile-based approaches: There’s just one catch: all of them suck. There’s daemontools, which barely builds (if at all) and then assumes that daemons don’t fork. Stupid. Not stupid. Essential. If a daemon forks, there is no way to manage its lifetime generically. Period. Any attempt to do so is full of dangerous race conditions. You can manage the lifetimes for forking daemons in non-generic ways (like interfacing with them through a socket), but to make a robust system, every daemon you use must have a "do not fork" option. Thankfully, I think all of the mainstream ones already do, and if not, it's not something hard to patch in. As far as I know, systemd is pushing the same thing, so at least it's not an uphill battle to get this fixed in real-world software that's broken. Rich