From owner-freebsd-questions@FreeBSD.ORG Thu Jan 5 15:55:58 2012 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 762141065670 for ; Thu, 5 Jan 2012 15:55:58 +0000 (UTC) (envelope-from aimass@yabarana.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 4976C8FC18 for ; Thu, 5 Jan 2012 15:55:58 +0000 (UTC) Received: by iadj38 with SMTP id j38so1595946iad.13 for ; Thu, 05 Jan 2012 07:55:57 -0800 (PST) MIME-Version: 1.0 Received: by 10.50.46.196 with SMTP id x4mr3235348igm.15.1325778957635; Thu, 05 Jan 2012 07:55:57 -0800 (PST) Sender: aimass@yabarana.com Received: by 10.231.77.5 with HTTP; Thu, 5 Jan 2012 07:55:57 -0800 (PST) In-Reply-To: <67A47520-6E8F-4D9E-974D-97105FE2205E@todoo.biz> References: <67A47520-6E8F-4D9E-974D-97105FE2205E@todoo.biz> Date: Thu, 5 Jan 2012 10:55:57 -0500 X-Google-Sender-Auth: gMUmDmUkbfbQ4muS0mvC648d5Hg Message-ID: From: Alejandro Imass To: bsd Content-Type: text/plain; charset=ISO-8859-1 Cc: Liste FreeBSD Subject: Re: Shared Memory allocation in jail 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, 05 Jan 2012 15:55:58 -0000 On Thu, Jan 5, 2012 at 8:56 AM, bsd wrote: > Hi, > > I am trying to run both postgres and zabbix in the same jail and I am only able to start postgres or zabbix not both of them. > Yeah bro, it bit me in the ass as well ;-) the SysV IPC is common for the whole system. So anything that uses IPC in jails will have to go through this process.... You have to change the Pg user's id and the chown the Pg files. I use a nomeclature for this and is the last 3 digits of the jail's IP and the original uid. Example The jail on 192.168.101.124 has a Pg user of 70124 for port NATing I use the contrary nomenclature like 12480 is the network port 80 of the same jail in th public IP as 12480. Anyway here is my recipe: pw usermod pgsql -u 70124 pw groupmod pgsql -g 70124 chown -R pgsql /usr/local/pgsql/ chgrp -R pgsql /usr/local/pgsql/ When you run ipcs from the jail You should the see something like the example below, where there is still one Pg on uid 70 but from the jail's perspective it's the pgsql user who now has uid of 70124 Message Queues: T ID KEY MODE OWNER GROUP Shared Memory: T ID KEY MODE OWNER GROUP m 1179648 5432001 --rw------- 70 70 m 131073 0 --rw------- 70 70 m 1572866 5432002 --rw------- pgsql pgsql Semaphores: T ID KEY MODE OWNER GROUP s 1703936 5432001 --rw------- 70 70 s 1703937 5432002 --rw------- 70 70 s 1703938 5432003 --rw------- 70 70 s 1572867 5432004 --rw------- 70 70 s 1572868 5432005 --rw------- 70 70 s 1572869 5432006 --rw------- 70 70 s 1572870 5432007 --rw------- 70 70 s 1179655 5432008 --rw------- pgsql pgsql s 1179656 5432009 --rw------- pgsql pgsql s 1179657 5432010 --rw------- pgsql pgsql s 1179658 5432011 --rw------- pgsql pgsql s 1179659 5432012 --rw------- pgsql pgsql s 1179660 5432013 --rw------- pgsql pgsql s 1179661 5432014 --rw------- pgsql pgsql Cheers, -- Alejandro Imass