From owner-freebsd-ports@FreeBSD.ORG Mon Feb 14 23:56:22 2005 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6963216A4CE; Mon, 14 Feb 2005 23:56:22 +0000 (GMT) Received: from mail-relay-4.tiscali.it (mail-relay-4.tiscali.it [213.205.33.44]) by mx1.FreeBSD.org (Postfix) with ESMTP id A28A343D2F; Mon, 14 Feb 2005 23:56:21 +0000 (GMT) (envelope-from sm@brightpebbles.org) Received: from [192.168.0.10] (84.222.164.198) by mail-relay-4.tiscali.it (7.1.021.3) id 42020357001CD974; Tue, 15 Feb 2005 00:56:20 +0100 Mime-Version: 1.0 (Apple Message framework v619.2) To: girgen@FreeBSD.org Message-Id: From: Salvatore Montefusco Date: Tue, 15 Feb 2005 00:55:35 +0100 X-Mailer: Apple Mail (2.619.2) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.1 cc: ports@FreeBSD.org Subject: FreeBSD Port: postgresql-server-8.0.1 X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Feb 2005 23:56:22 -0000 Hi, I'm running Freebsd 5.3 and recently installed the postgresql-server-8.0.1 port. Adding custom postgresql_data="/somewhere" in rc.conf, I get an error when /urs/local/etc/010.pgsql.sh rc script is launched with the commands start, stop, restart, status (except initdb, which works fine). By looking at /urs/local/etc/010.pgsql.sh source and testing it with bash -x, I've found out that the problem is caused by $command_args variable, which is evaluated before postgresql_data is assigned in rc.conf. That's the reason why the script doesn't fail when you call initdb: the command doesn't use $command_args. I've got a workaround by moving $command_args assignment line in to the postgresql_command function, before calling su, but actually I don't know if it is the right way to solve the problem. postgresql_command() { command_args="-D ${postgresql_data} ${postgresql_flags} $1" su -m ${postgresql_user} -c "exec ${command} ${command_args}" } I hope it will be useful. Anyway, you do a great job everyday. Thank you and keep going. Salvatore Montefusco