[Pkg-postgresql-public] Bug#710093: postgresql: not started automatically after installation in chroot

Christoph Berg myon at debian.org
Sat Jun 1 16:42:25 UTC 2013


Re: Andreas Beckmann 2013-06-01 <51AA008C.1070202 at debian.org>
> > Btw, can you share this policy-rc.d?
> 
> #!/bin/sh
> test "$1" = "mysql" && exit 0
> test "$1" = "postgresql" && exit 0
> exit 101

Thanks.

> Narrowing this down to installing perl ... which reminded me of your
> first reply:

Oh, indeed. And we seem to ignore errors :-/

Creating new cluster 9.1/main ...
  config /etc/postgresql/9.1/main
  data   /var/lib/postgresql/9.1/main
  locale C
  port   5432
update-alternatives: using /usr/share/postgresql/9.1/man/man1/postmaster.1.gz to provide /usr/share/man/man1/postmaster.1.gz (postmaster.1.gz) in auto mode
[ ok ] Starting PostgreSQL 9.1 database server: main.
root at pgdgbuild:/# pg_lsclusters 
Ver Cluster Port Status Owner    Data directory               Log file
9.1 main    5432 down   postgres /var/lib/postgresql/9.1/main /var/log/postgresql/postgresql-9.1-main.log
root at pgdgbuild:/# pg_ctlcluster 9.1 main start
Can't locate File/Path.pm in @INC (@INC contains: /usr/share/postgresql-common /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl) at /usr/bin/pg_ctlcluster line 180.
BEGIN failed--compilation aborted at /usr/bin/pg_ctlcluster line 180.
root at pgdgbuild:/# echo $?
2

Will fix that, thanks for debugging.

> As that is not an available option, I'll try to parse the port from the
> config file ...
>   awk '/^port/ { print $3 }' /etc/postgresql/9.1/main/postgresql.conf
> or can you give me a short perl expression that does this version-agnostic?

# awk '/^port/ { print $3 }' /etc/postgresql/*/main/postgresql.conf :)

Or using the proper tools:

# pg_lsclusters -h | awk '{ print $3 }'

(append | head -n1 if you like)

> Of course this could also be solved by running the piuparts tests in
> real virtualized environments instead of plain chroots ... patches
> welcome :-)

What we do for the apt.postgresql.org tests, is to wrap everything in
"unshare -n". This will give you a new networking stack in which you
can reopen 5432. (You need to at least "ifconfig lo up", and as you
will probably want to download packages, you'd need to configure
proper networking too.)

Of course real virtualiziation would be nice to have for use, too...

Christoph
-- 
cb at df7cb.de | http://www.df7cb.de/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-postgresql-public/attachments/20130601/22f0bead/attachment.pgp>


More information about the Pkg-postgresql-public mailing list