Received: from bsdi.nyvlem.mine.nu (node123e0.a2000.nl [24.132.35.224]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f4RGGxA66995 for ; Sun, 27 May 2001 12:16:59 -0400 (EDT) (envelope-from mdev@idg.nl) Received: from server.idg.nl (server.nyvlem.mine.nu [192.168.0.1]) by bsdi.nyvlem.mine.nu (8.9.3/8.9.3) with ESMTP id SAA25290 for ; Sun, 27 May 2001 18:17:33 +0200 (CEST) Message-Id: <5.0.2.1.2.20010527181355.03ff1ec0@tmp.idg.nl> X-Sender: mdev@tmp.idg.nl X-Mailer: QUALCOMM Windows Eudora Version 5.0.2 Date: Sun, 27 May 2001 18:14:08 +0200 To: PostgreSQL Adminlist From: Melvyn Sopacua Subject: Postgres and chroot Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Archive-Number: 200105/147 X-Sequence-Number: 1504 Hi all, I'm new to the list as well as to Postgres. At present we're using MySQL, on a BSD platform, and migrating the databases to AIX, keeping BSD on the frontend. The frontend is powered by Php and Apache and a few Perl scripts since I just love GD::Graphs3d :-). I hope I can contribute in the near future, but my guess is, I'll be askin' a lot first :-). Especially since it's quite a different setup as opposed to MySQL. We're considering Postgres at least for some more demanding webapplications and therefore I've setup a little test environment at home on a similar box (well - software/OS then). As for the first questions: It's customary for us to run web-accessible services chrooted. However, postgres needs to change user context and chroot requires the root user. There are two things bugging about the current Postgres implementation, with respect to a chrooted environment: 1) Postgres requires me to have 'su' in the chrooted env 2) Postgres makes a shell call to the 'cp' command when creating new databases. The first I've overcome, with the not-so-elegant script below, but the second is not so easy. So my questions: -- Does anybody run PostgreSQL chrooted and so, how? -- Is there a way to use PostgreSQL and not have `cp' in the environment? Many thanx, in advance. The startupscript: $ cat /chroot/pgsql/startpgsql.sh #!/bin/sh cp -p /usr/bin/su /chroot/bin/su /usr/sbin/chroot /chroot /bin/su postgres -c "/pgsql/bin/postmaster -i -D /pgsql/data &" sleep 2 rm /chroot/bin/su -- Best regards, Melvyn Sopacua