Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Aug 2007 10:45:10 +0200
From:      Karsten Rothemund <karsten@photor.de>
To:        freebsd-jail@freebsd.org
Subject:   Running postgres 8.2 in a jail
Message-ID:  <20070830084510.GA66523@www.photor.de>

next in thread | raw e-mail | index | archive | help

--BOKacYhQ+x31HxR3
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hello list,

I played a little bit with jails on FBSD 6.2 (just to learn). One jail
I want to use as database server, so installed postgresql82-server
from the ports.=20

But when I try to initdb I get the following:

pgsql# /usr/local/etc/rc.d/postgresql initdb
The files belonging to this database system will be owned by user "pgsql".
This user must also own the server process.

The database cluster will be initialized with locales
  COLLATE:  C
  CTYPE:    en_US.UTF-8
  MESSAGES: en_US.UTF-8
  MONETARY: en_US.UTF-8
  NUMERIC:  en_US.UTF-8
  TIME:     en_US.UTF-8

creating directory /usr/local/pgsql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 10
selecting default shared_buffers/max_fsm_pages ... 400kB/20000
creating configuration files ... ok
creating template1 database in /usr/local/pgsql/data/base/1 ... FATAL:  cou=
ld not create semaphores: No space left on device
DETAIL:  Failed system call was semget(1, 17, 03600).
HINT:  This error does *not* mean that you have run out of disk space.
        It occurs when either the system limit for the maximum number of se=
maphore sets (SEMMNI), or the system wide maximum number of semaphores (SEM=
MNS), would be exceeded.  You need to raise the respective kernel parameter=
.  Alternatively, reduce PostgreSQL's consumption of semaphores by reducing=
 its max_connections parameter (currently 10).
        The PostgreSQL documentation contains more information about config=
uring your system for PostgreSQL.
child process exited with exit code 1
initdb: removing data directory "/usr/local/pgsql/data"

As I understand, I have to change some sysctls to
- allow the jail to use some resources: security.jail.sysvipc_allowed=3D1
- raise some values of kern.ipc; this looks like the following:
pgsql# sysctl kern.ipc | grep sem
kern.ipc.semmap: 256
kern.ipc.semmni: 10
kern.ipc.semmns: 60
kern.ipc.semmnu: 30
kern.ipc.semmsl: 60
kern.ipc.semopm: 100
kern.ipc.semume: 10
kern.ipc.semusz: 92
kern.ipc.semvmx: 32767
kern.ipc.semaem: 16384
- and the same with shared memory (got this from the postgres
  documentation)
pgsql# sysctl -a | grep shm
kern.ipc.shmmax: 134217728
kern.ipc.shmmin: 1
kern.ipc.shmmni: 192
kern.ipc.shmseg: 128
kern.ipc.shmall: 32768
kern.ipc.shm_use_phys: 0
kern.ipc.shm_allow_removed: 0

but postgres does still not initdb (I tried also with postgresql74-server
which worked).=20

The question is simple: what is missing, what is wrong?

(I can of course provide any config and information if more is needed)

Thank you for any hint,

Karsten

--=20

Karsten Rothemund <karsten@photor.de>     /"\
PGP-Key:     0x7019CAA5                   \ /
Fingerprint: E752 C759 B9B2 2057 E42F      \  ASCII Ribbon Campaign
             50EE 47AC A7CE 7019 CAA5     / \ Against HTML Mail and News

--BOKacYhQ+x31HxR3
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (FreeBSD)

iD8DBQFG1oOWR6ynznAZyqURAsROAJ95/+MMeAY1BrmjnmufIaD22mT+TgCguFNz
W7eACnKdK7pIz236WBMTErE=
=2Zc+
-----END PGP SIGNATURE-----

--BOKacYhQ+x31HxR3--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070830084510.GA66523>