From owner-freebsd-questions@FreeBSD.ORG Thu Oct 29 03:37:01 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4E99106566C for ; Thu, 29 Oct 2009 03:37:01 +0000 (UTC) (envelope-from sfourman@gmail.com) Received: from mail-pw0-f44.google.com (mail-pw0-f44.google.com [209.85.160.44]) by mx1.freebsd.org (Postfix) with ESMTP id 7F3078FC14 for ; Thu, 29 Oct 2009 03:37:01 +0000 (UTC) Received: by pwj8 with SMTP id 8so1277002pwj.3 for ; Wed, 28 Oct 2009 20:37:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=vfTW3mPzTUCtuJyLcsf4bvdraGq3fNMiZd5azKIDJ7g=; b=ONBgVdvMwuuiTYjTmZm7X7tOZbumU5KKMziqlNaDh7WseLTjPnL2MdDkOmXXipUv9O Yr4tz4PYZfsgZUd+kLgK4rmfUe973+PKv9iTnsDfsqs58+Umuq/Pzh6Ncx3nSrE4hZlh DA4/2L0nWEc0UiD9E7cb1lTu/dXv3MlAbOJ2s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=CsbSKKcZ4Ix+SlofE8b/V24cGtF9US0URTkKRReW5VXkoJNEit9RppM2I/X6zgy47Q 8SA5q1D9Thm/XrUUBxnkg43OeX7OBSwCLCo7tF0npEREMrSAQ/Xgp7cK+XH2C2js00Qd UdVMz1F7yYa8habAhf0CPTLk4iollkZXRMzlM= MIME-Version: 1.0 Received: by 10.142.247.38 with SMTP id u38mr1575047wfh.349.1256787421079; Wed, 28 Oct 2009 20:37:01 -0700 (PDT) Date: Wed, 28 Oct 2009 22:37:01 -0500 Message-ID: <11167f520910282037s49d40fd7x7617e996a27d4f22@mail.gmail.com> From: "Sam Fourman Jr." To: freebsd general questions Content-Type: text/plain; charset=ISO-8859-1 Subject: Multiple PostgreSQL 8.4 instances in FreeBSD 8.0 RC2 Jails X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Oct 2009 03:37:01 -0000 Hello List, I want to setup 5 postgreSQL 8.4 servers in separate jails on a amd64 FreeBSD 8.0 RC2 machine while searching the web for someone that has done this before I found this: my question is this... is this still relevant on FreeBSD 8.0 RC2(amd64) and postgreSQL 8.4 The following was taken from this link http://www.opensubscriber.com/message/freebsd-stable@freebsd.org/1244846.html "Marc G. Fournier" writes: > You've all lost me here ... what exactly is the problem? You can't run multiple instances of PostgreSQL on the same machine (even in chroot or jail, even without TCP/IP support) without changing the port number in postgresql.conf. PostgreSQL creates shared memory segments with keys based on the port number, so separate instances will try to create and use the same segments if configured to use the same port number. > PostgreSQL > works under FreeBSD 4.x jails without any modifications, so how is > PostgreSQL itself currently broken? It seems to me that the problem > is with FreeBSD 5.x's jail side of things, if the same daemon runs > fine under 4.x, but, nto under 5.x ... PostgreSQL has always had this problem, both on 4.x and 5.x. A hack was put in place last November to work around it, but it still exists, and while it may now be possible (with 8.0) for multiple postmasters to run on the same machine, it is also still possible for malicious code in one jail to crash postmasters in other jails. The underlying problem is that FreeBSD does not have separate SHM namespaces in each jail, but, as has already been pointed out, that problem is fairly hard to fix. Patching PostgreSQL to use something else than SysV shared memory is easier and will benefit other OSes as well. DES Sam Fourman Jr. Fourman Networks