package/postgresql: enable data checksums by default for initdb
PATCH 2/2 package/postgresql: enable data checksums by default for initdb
From: Pascal de Bruijn <[email protected]>
This makes PostgreSQL as robust as possible by default
--- package/postgresql/S50postgresql | 2 +- package/postgresql/postgresql.service | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
package/postgresql/S50postgresql +1 -1
@@ -7,7 +7,7 @@ umask 077 if [ ! -f /var/lib/pgsql/PG_VERSION ]; then echo "Initializing postgresql data base..." - su - postgres -c '/usr/bin/pg_ctl initdb -D /var/lib/pgsql -o --locale=en_US.UTF-8' + su - postgres -c '/usr/bin/pg_ctl initdb -D /var/lib/pgsql -o --locale=en_US.UTF-8 -o --data-checksums' echo "done" fi
package/postgresql/postgresql.service +1 -1
@@ -17,7 +17,7 @@ StandardError=syslog SyslogIdentifier=postgres PIDFile=/var/lib/pgsql/postmaster.pid -ExecStartPre=/bin/sh -c "if [ ! -f /var/lib/pgsql/PG_VERSION ]; then /usr/bin/pg_ctl initdb -D /var/lib/pgsql -o --locale=en_US.UTF-8; fi" +ExecStartPre=/bin/sh -c "if [ ! -f /var/lib/pgsql/PG_VERSION ]; then /usr/bin/pg_ctl initdb -D /var/lib/pgsql -o --locale=en_US.UTF-8 -o --data-checksums; fi" ExecStart=/usr/bin/postgres -D /var/lib/pgsql ExecReload=/usr/bin/kill -HUP $MAINPID KillMode=mixed
Signature · 1 line
2.7.4
PATCH 2/2 package/postgresql: enable data checksums by default for initdb
Hello Pascal,
Quoted 15 lines · Pascal de Bruijn
From: Pascal de Bruijn <[email protected]>
This makes PostgreSQL as robust as possible by default
Signed-off-by Pascal de Bruijn <[email protected]>--- package/postgresql/S50postgresql | 2 +- package/postgresql/postgresql.service | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)package/postgresql/S50postgresql +0
-0
package/postgresql/S50postgresql umask 077 · line 10
Quoted 5 lines
package/postgresql/S50postgresql +1
-1@@ -7,7 +7,7 @@ umask 077 if [ ! -f /var/lib/pgsql/PG_VERSION ]; then echo "Initializing postgresql data base..." - su - postgres -c '/usr/bin/pg_ctl initdb -D /var/lib/pgsql -o --locale=en_US.UTF-8' + su - postgres -c '/usr/bin/pg_ctl initdb -D /var/lib/pgsql -o --locale=en_US.UTF-8 -o --data-checksums'
Thanks for the patch, but I believe buildroot is about providing a very basic/minimum setup as starting point customized projects and the postgresql documentation states ([1]):
Enabling checksums may incur a noticeable performance penalty.
And I think not everyone (specially for embedded projects) will accept this performance vs. data security tradeoff..., same applies to your locale/en_US.UTF-8 suggestion (not everyone will be happy/use en_US and I hope no one will run a non-customized production project)...
Regards,
Peter
Quoted 16 lines
package/postgresql/S50postgresql +0
-0echo "done" fipackage/postgresql/postgresql.service +1
-1@@ -17,7 +17,7 @@ StandardError=syslog SyslogIdentifier=postgres PIDFile=/var/lib/pgsql/postmaster.pid -ExecStartPre=/bin/sh -c "if [ ! -f /var/lib/pgsql/PG_VERSION ]; then /usr/bin/pg_ctl initdb -D /var/lib/pgsql -o --locale=en_US.UTF-8; fi" +ExecStartPre=/bin/sh -c "if [ ! -f /var/lib/pgsql/PG_VERSION ]; then /usr/bin/pg_ctl initdb -D /var/lib/pgsql -o --locale=en_US.UTF-8 -o --data-checksums; fi" ExecStart=/usr/bin/postgres -D /var/lib/pgsql ExecReload=/usr/bin/kill -HUP $MAINPID KillMode=mixed