Solved FreeBSD 12.0p10 PostgreSQL-9.5 Cannot initialise postgresql in a jail

byrnejb

Aspiring Daemon

Reaction score: 45
Messages: 552

I have set up a jail specifically for PostgreSQL. PostgreSQL-9.5 is installed via the pkg manager. When I try to initialise it I get this:

Code:
/usr/local/etc/rc.d/postgresql oneinitdb
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 locale "C".
The default text search configuration will be set to "english".

Data page checksums are disabled.

creating directory /usr/local/pgsql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 10
selecting default shared_buffers ... 400kB
selecting default timezone ... UTC
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
creating template1 database in /usr/local/pgsql/data/base/1 ... FATAL:  could not create shared memory segment: Function not implemented
DETAIL:  Failed system call was shmget(key=5432001, size=56, 03600).
child process exited with exit code 1
initdb: removing data directory "/usr/local/pgsql/data"

What else must be done to get Postgres to run inside a jail?
 

julp

Member

Reaction score: 42
Messages: 68

Did you run your jail with:
Code:
sysvmsg = new;
sysvsem = new;
sysvshm = new;
?

See jail(8) for details.
 
OP
byrnejb

byrnejb

Aspiring Daemon

Reaction score: 45
Messages: 552

Thank you. Your suggestion worked. I use ezjail so I added these to the jail definition file: /usr/local/etc/ezjail/pgsql95:

Code:
export jail_pgsql95_parameters="sysvmsg=new sysvsem=new sysvshm=new"
 
Top