Skip to contentSkip to conversation

postgresql issue

Buildroot Waldemar Brodkorb 2 participants 4 messages Feb 16, 2025 – Feb 19, 2025

lore
Share & tools
lore
#0 lore raw

Hi,

I am using Buildroot master. I try to use Postgresql Server. I have locales enabled and building for a raspberry pi5.

wbx@neon:~/buildroot$ grep LOCALE .config
BR2_NEEDS_HOST_UTF8_LOCALE=y
BR2_ENABLE_LOCALE=y
# BR2_ENABLE_LOCALE_PURGE is not set
BR2_GENERATE_LOCALE="en_US"
# BR2_PACKAGE_SYSTEMD_LOCALED is not set

Journalctl reports:

Oct 08 15:42:34 buildroot systemd[1]: Starting PostgreSQL database server...
Oct 08 15:42:35 buildroot postgres[268]: The files belonging to this database system will be owned by user "postgres".
Oct 08 15:42:35 buildroot postgres[268]: This user must also own the server process.
Oct 08 15:42:35 buildroot postgres[268]: initdb: error: invalid locale settings; check LANG and LC_* environment variables
Oct 08 15:42:35 buildroot postgres[261]: pg_ctl: database system initialization failed
Oct 08 15:42:35 buildroot systemd[1]: postgresql.service: Control process exited, code=exited, status=1/FAILURE
Oct 08 15:42:35 buildroot systemd[1]: :5:185m:5:185mpostgresql.service: Failed with result 'exit-code'.
Oct 08 15:42:35 buildroot systemd[1]: Failed to start PostgreSQL database server.

Any idea? I have set the environment variable LANG to en_US.UTF-8.

best regards
Waldemar
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#1 lore raw

Hello Waldemar,

Quoted 22 lines · Waldemar Brodkorb

Hi,

I am using Buildroot master. I try to use Postgresql Server. I have locales enabled and building for a raspberry pi5.

wbx@neon:~/buildroot$ grep LOCALE .config
BR2_NEEDS_HOST_UTF8_LOCALE=y
BR2_ENABLE_LOCALE=y
# BR2_ENABLE_LOCALE_PURGE is not set
BR2_GENERATE_LOCALE="en_US"
# BR2_PACKAGE_SYSTEMD_LOCALED is not set

Journalctl reports:

Oct 08 15:42:34 buildroot systemd[1]: Starting PostgreSQL database server...
Oct 08 15:42:35 buildroot postgres[268]: The files belonging to this database system will be owned by user "postgres".
Oct 08 15:42:35 buildroot postgres[268]: This user must also own the server process.
Oct 08 15:42:35 buildroot postgres[268]: initdb: error: invalid locale settings; check LANG and LC_* environment variables
Oct 08 15:42:35 buildroot postgres[261]: pg_ctl: database system initialization failed
Oct 08 15:42:35 buildroot systemd[1]: postgresql.service: Control process exited, code=exited, status=1/FAILURE
Oct 08 15:42:35 buildroot systemd[1]: :5:185m:5:185mpostgresql.service: Failed with result 'exit-code'.
Oct 08 15:42:35 buildroot systemd[1]: Failed to start PostgreSQL database server.
Quoted 1 line

Any idea? I have set the environment variable LANG to en_US.UTF-8.

Reminds me of an aged patch set

[v1,1/3] package/glibc: install locale cmd independent of NLS (see [1]) [v1,2/3] package/postgresql: needs locale command (see [2]) [v1,3/3] package/postgresql: set locale for initdb to C (see [3])

...not sure if still appropriate...

Regards,
Peter

[1] https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/
[2] https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/
[3] https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/

Quoted 7 lines

best regards
Waldemar
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#2 lore raw

Hi,
Peter Seiderer wrote,

Quoted 28 lines

Hello Waldemar,

Quoted 22 lines · Waldemar Brodkorb

Hi,

I am using Buildroot master. I try to use Postgresql Server. I have locales enabled and building for a raspberry pi5.

wbx@neon:~/buildroot$ grep LOCALE .config
BR2_NEEDS_HOST_UTF8_LOCALE=y
BR2_ENABLE_LOCALE=y
# BR2_ENABLE_LOCALE_PURGE is not set
BR2_GENERATE_LOCALE="en_US"
# BR2_PACKAGE_SYSTEMD_LOCALED is not set

Journalctl reports:

Oct 08 15:42:34 buildroot systemd[1]: Starting PostgreSQL database server...
Oct 08 15:42:35 buildroot postgres[268]: The files belonging to this database system will be owned by user "postgres".
Oct 08 15:42:35 buildroot postgres[268]: This user must also own the server process.
Oct 08 15:42:35 buildroot postgres[268]: initdb: error: invalid locale settings; check LANG and LC_* environment variables
Oct 08 15:42:35 buildroot postgres[261]: pg_ctl: database system initialization failed
Oct 08 15:42:35 buildroot systemd[1]: postgresql.service: Control process exited, code=exited, status=1/FAILURE
Oct 08 15:42:35 buildroot systemd[1]: :5:185m:5:185mpostgresql.service: Failed with result 'exit-code'.
Oct 08 15:42:35 buildroot systemd[1]: Failed to start PostgreSQL database server.
Quoted 1 line

Any idea? I have set the environment variable LANG to en_US.UTF-8.

Quoted 7 lines

Reminds me of an aged patch set

[v1,1/3] package/glibc: install locale cmd independent of NLS (see [1]) [v1,2/3] package/postgresql: needs locale command (see [2]) [v1,3/3] package/postgresql: set locale for initdb to C (see [3])

...not sure if still appropriate...

Patch 3 worked for me! I get an error about missing locale command, but the database is starting. Let's see if zabbix works, too.

@Maintainers, what you think about adding this patch?

best regards
Waldemar

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#3 lore raw
Quoted 37 lines · Waldemar Brodkorb

Hi,
Peter Seiderer wrote,

Quoted 34 lines

Hello Waldemar,

Quoted 22 lines · Waldemar Brodkorb

Hi,

I am using Buildroot master. I try to use Postgresql Server. I have locales enabled and building for a raspberry pi5.

wbx@neon:~/buildroot$ grep LOCALE .config
BR2_NEEDS_HOST_UTF8_LOCALE=y
BR2_ENABLE_LOCALE=y
# BR2_ENABLE_LOCALE_PURGE is not set
BR2_GENERATE_LOCALE="en_US"
# BR2_PACKAGE_SYSTEMD_LOCALED is not set

Journalctl reports:

Oct 08 15:42:34 buildroot systemd[1]: Starting PostgreSQL database server...
Oct 08 15:42:35 buildroot postgres[268]: The files belonging to this database system will be owned by user "postgres".
Oct 08 15:42:35 buildroot postgres[268]: This user must also own the server process.
Oct 08 15:42:35 buildroot postgres[268]: initdb: error: invalid locale settings; check LANG and LC_* environment variables
Oct 08 15:42:35 buildroot postgres[261]: pg_ctl: database system initialization failed
Oct 08 15:42:35 buildroot systemd[1]: postgresql.service: Control process exited, code=exited, status=1/FAILURE
Oct 08 15:42:35 buildroot systemd[1]: :5:185m:5:185mpostgresql.service: Failed with result 'exit-code'.
Oct 08 15:42:35 buildroot systemd[1]: Failed to start PostgreSQL database server.
Quoted 1 line

Any idea? I have set the environment variable LANG to en_US.UTF-8.

Reminds me of an aged patch set

[v1,1/3] package/glibc: install locale cmd independent of NLS (see [1]) [v1,2/3] package/postgresql: needs locale command (see [2]) [v1,3/3] package/postgresql: set locale for initdb to C (see [3])

Quoted 6 lines
Quoted 1 line

...not sure if still appropriate...

Patch 3 worked for me! I get an error about missing locale command, but the database is starting. Let's see if zabbix works, too.

@Maintainers, what you think about adding this patch?

About locale command in musl:
https://git.adelielinux.org/adelie/musl-locales/

We can try to integrate it into buildroot.

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot