Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't Install Postgresql #30

Open
9emss opened this issue Jun 8, 2023 · 3 comments
Open

Can't Install Postgresql #30

9emss opened this issue Jun 8, 2023 · 3 comments

Comments

@9emss
Copy link

9emss commented Jun 8, 2023

Hey i have issue to install postgresql on chroot. every method i have tried, but nothing works. they have same error about creating shared memory.

@FerryAr
Copy link
Owner

FerryAr commented Jul 4, 2023

mount /dev/shm manually

eg. mount -t tmpfs tmpfs /data/ubuntu/dev/shm

@ppvan
Copy link

ppvan commented May 25, 2024

mount /dev/shm manually

eg. mount -t tmpfs tmpfs /data/ubuntu/dev/shm

Does not seem to work

I also notice this mount already in the bootlinux_init. May be it's another issue

The full error (debian 11):

/usr/lib/postgresql/13/bin/initdb -D /var/lib/postgresql/data
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "C".
The default database encoding has accordingly been set to "SQL_ASCII".
The default text search configuration will be set to "english".

Data page checksums are disabled.

creating directory /var/lib/postgresql/data ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 20
selecting default shared_buffers ... 400kB
selecting default time zone ... Etc/UTC
creating configuration files ... ok
running bootstrap script ... 2024-05-25 08:45:06.009 UTC [24688] FATAL:  could not create shared memory segment: Function not implemented
2024-05-25 08:45:06.009 UTC [24688] DETAIL:  Failed system call was shmget(key=55302, size=56, 03600).
child process exited with exit code 1
initdb: removing data directory "/var/lib/postgresql/data"

@ppvan
Copy link

ppvan commented May 25, 2024

After some investigations, I'm been able to get postgres running.
First compile android-shmem from source inside chroot eviroment (or cross compile on PC, as long as it is same architecture with your phone cpu).

You'll need to make a modification to this part, remove the if statement(I have no idea what will it affected).

Then move the .so file to /lib (inside chroot), mine is /lib/libandroid-shmem.so
Now before do any thing with postgres server, you it to custom LD_PRELOAD like this

env LD_PRELOAD="/lib/libandroid-shmem.so" pg_ctl start

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants