From owner-freebsd-stable@FreeBSD.ORG Tue Apr 4 14:17:31 2006 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 667D816A400 for ; Tue, 4 Apr 2006 14:17:31 +0000 (UTC) (envelope-from vivek@khera.org) Received: from yertle.kcilink.com (yertle.kcilink.com [65.205.34.180]) by mx1.FreeBSD.org (Postfix) with ESMTP id AC57C43D58 for ; Tue, 4 Apr 2006 14:17:23 +0000 (GMT) (envelope-from vivek@khera.org) Received: from [192.168.7.103] (host-103.int.kcilink.com [192.168.7.103]) by yertle.kcilink.com (Postfix) with ESMTP id A2981B80C for ; Tue, 4 Apr 2006 10:17:19 -0400 (EDT) Mime-Version: 1.0 (Apple Message framework v746.3) In-Reply-To: <20060403205630.N947@ganymede.hub.org> References: <20060403140902.C947@ganymede.hub.org> <20060403182504.S76562@fledge.watson.org> <20060403144916.J947@ganymede.hub.org> <20060403230850.P76562@fledge.watson.org> <20060403205630.N947@ganymede.hub.org> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <136F2379-153C-4013-BEC1-2BBA36129810@khera.org> Content-Transfer-Encoding: 7bit From: Vivek Khera Date: Tue, 4 Apr 2006 10:17:18 -0400 To: freebsd-stable X-Mailer: Apple Mail (2.746.3) Subject: Re: [HACKERS] semaphore usage "port based"? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Apr 2006 14:17:31 -0000 On Apr 3, 2006, at 8:07 PM, Marc G. Fournier wrote: > All PostgreSQL processes use "port * 1000" as their starting port > for semId ... if "port * 1000" is reported as in use, the first > thing that the PostgreSQL process does is kill(PID, 0) the PID > returned by semctl(GETPID) to see if, in fact, there is a process > running ... if not, PostgreSQL reuses that semaphore, if not, it > goes to (port*1000)+1, and tries again ... until it can find a free > semaphore that isn't in use ... Perhaps you can hack into the postgresql master a flag that alters the "1000" parameter, or starts at a port * 1000 + N, then hard-code that flag into your startup script per jail.