From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: * X-Spam-ASN: AS33070 50.56.128.0/17 X-Spam-Status: No, score=1.3 required=5.0 tests=RDNS_NONE shortcircuit=no autolearn=no version=3.3.2 X-Original-To: archivist@yhbt.net Delivered-To: archivist@dcvr.yhbt.net Received: from rubyforge.org (unknown [50.56.192.79]) by dcvr.yhbt.net (Postfix) with ESMTP id 31C8C20281 for ; Tue, 10 Dec 2013 12:53:30 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id C16FD2E185; Tue, 10 Dec 2013 12:53:28 +0000 (UTC) X-Original-To: mongrel-unicorn@rubyforge.org Delivered-To: mongrel-unicorn@rubyforge.org X-Greylist: delayed 397 seconds by postgrey-1.31 at rubyforge; Tue, 10 Dec 2013 12:53:18 UTC Received: from petteriraty.eu (petteriraty.eu [188.40.80.83]) by rubyforge.org (Postfix) with ESMTP id ECF5E2E185 for ; Tue, 10 Dec 2013 12:53:18 +0000 (UTC) Received: from ras-215-126.org.aalto.fi (ras-215-126.org.aalto.fi [130.233.215.126]) by petteriraty.eu (Postfix) with ESMTPSA id DA93BCA09B for ; Tue, 10 Dec 2013 12:46:31 +0000 (UTC) Message-ID: <52A70D26.7020105@gentoo.org> Date: Tue, 10 Dec 2013 14:46:30 +0200 From: =?ISO-8859-1?Q?Petteri_R=E4ty?= MIME-Version: 1.0 To: mongrel-unicorn@rubyforge.org Subject: Re: Issues with PID file renaming References: <20131126012036.GA5868@dcvr.yhbt.net> In-Reply-To: <20131126012036.GA5868@dcvr.yhbt.net> X-Enigmail-Version: 1.6 X-BeenThere: mongrel-unicorn@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: mongrel-unicorn-bounces@rubyforge.org Errors-To: mongrel-unicorn-bounces@rubyforge.org On 26.11.2013 3.20, Eric Wong wrote: >> >> I think the way 4.6.2 worked is better. There should be a pid file for >> the new master process the moment it's created. > >> What do you think? > > How about having the old process create a hard link to .oldbin, > and having the new one override the pid if Process.ppid == pid file? > The check is still racy, but that's what pid files are :< > Isn't it possible to always keep a valid pid file by using the fact that mv is atomic? Basically the new process writes the pid first to a temp file and then moves it over the old pid file after having hard linked the file to .oldbin? $ echo "1" > foo.pid $ ln foo.pid foo.oldpid $ echo "2" > tmp $ mv tmp foo.pid $ cat *pid 1 2 Regards, Petteri _______________________________________________ Unicorn mailing list - mongrel-unicorn@rubyforge.org http://rubyforge.org/mailman/listinfo/mongrel-unicorn Do not quote signatures (like this one) or top post when replying