Use newly introduced procd_add_restart_mount_trigger to make sure
postmaster gets started only once PGDATA becomes available.
Relocate socket directory to /var/lib/postgresql to make it possible
to run postgresql inside a ujail.
Use signal for shutdown, so it works nicely with jail.
Allow multiple script in UCI 'config postgres-db' to be a list and
run them in order listed.
User more silent methods to check for db or role existence and make
it easy to create several databases owned by the same user by passing
the same credentials multiple times.
Remove disfunctional reload handler.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
configure.in checks for "ARMv8 CRC32C intrinsics" and goes as far as
adding "-march=armv8-a+crc" to the target flags if the compiler allows
it. This can clash with the OpenWrt target flags in
CONFIG_TARGET_OPTIMIZATION. If for example the latter is set to
"-mcpu=cortex-a9" the following warning is issued:
cc1: warning: switch '-mcpu=cortex-a9' conflicts with '-march=armv5t' switch
This commit prevents configure.in from adding the mentioned flag. The
addition is unwanted when cross-compiling.
An issue was raised for this recently, see [1].
[1] https://github.com/openwrt/packages/issues/16034
Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
The minimum version of GCC according to prereq-build.mk is 4.8 which
defaults to gnu89. This breaks the host build when the host GCC is less
than 5, which defaults to gnu99. Add a simple CFLAG to fix.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Currently the pc file has includedir hard coded to "/usr/include" and
libdir to "/usr/lib". This commit changes this so they can be controlled
via the "prefix" variable.
Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
Fix breaking change introduced in the main tree with a commit
7519a36774ca ("base-files,procd: add generic service status") where the
old service `status` callback function doesn't work anymore and needs to
be renamed to `status_service`. This name was chosen for consistency
with start and stop function callbacks, which are using `start_service`
and `stop_service` naming schemes.
While at it, fix whitespace issues in the status_service as well.
Ref: http://lists.infradead.org/pipermail/openwrt-devel/2019-September/019035.html
Reported-by: Dirk Brenken <dev@brenken.org>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
Version 11.3 is the current stable relase.
Changes between 9.3 and 11.3:
- pg_receivexlog, pg_resetxlog and pg_xlogdump have been replaced with pg_resetwal
- ZIC config variable must be set when cross compiling
- disable systemd support
- ecpg is no longer needed for building
- MAKELEVEL must be set to 0 when called from another makefile
- Setting AC_CONFIG_AUX_DIR([config]) is no longer requried
- Decrease build time by removing unnecessary configure checks
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
Fixes CVE-2019-10129: Memory disclosure in partition routing
Does **NOT** fix CVE-2019-9193 which PostgreSQL doesn't consider a
security issue, see [1].
[1]: https://www.postgresql.org/about/news/1935/
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Revert the addition of build dependency in commit 2d1694ff7
to a non-existent host build of zlib.
The host build of zlib was removed already in April 2018 by
8dcd941d8b (diff-1ed408c61d79f9c6c5d197333e94ce8d)
which made zlib a build tool defined in /tools
The newly introduced build dependency causes always a warning like:
WARNING: Makefile 'package/feeds/packages/postgresql/Makefile'
has a build dependency on 'zlib/host', which does not exist
Not sure what was the error that 2d1694ff7 tried to fix,
but reference to a non-existent host build is not the solution.
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
spotted on buildbot trying postgresql/host build:
configure: error: zlib library not found
Fix this by adding zlib/host to HOST_BUILD_DEPENDS.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
This update includes fixes for the following CVEs:
- CVE-2018-1115
- CVE-2018-10925
- CVE-2018-10915
Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
When building for ARC the compile fails with:
/var/lib/buildbot/slaves/dave-builder/arc_arc700/build/sdk/build_dir/target-arc_arc700_uClibc/postgresql-9.6.5/src/include/storage/s_lock.h:899:2: error: #error PostgreSQL does not have native spinlock support on this platform. To continue the compilation, rerun configure using --disable-spinlocks. However, performance will be poor. Please report this to pgsql-bugs@postgresql.org.
#error PostgreSQL does not have native spinlock support on this platform. To continue the compilation, rerun configure using --disable-spinlocks. However, performance will be poor. Please report this to pgsql-bugs@postgresql.org.
So disable spinlocks when compiling for this arch. This was done
likewise for the avr32 target, which is not supported anymore, so this
can be deleted.
Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
- The extra include is removed; the postgresql build system adds this
include by itself.
- '-lpthread' is removed; the postgresql build system is able to detect
how to access pthread features by itself.
- '$(FPIC)' is removed; adding this to CFLAGS is not recommendable:
a) The postgresql build system adds its own PIC flag behind OpenWrt's
CFLAGS when compiling shared objects, overriding OpenWrt's setting.
b) Forcing applications into PIC mode will just slow them down.
c) This leads to build failures on aarch64:
access/transam/commit_ts.o: In function `CommitTsPagePrecedes':
commit_ts.c:(.text+0x14): relocation truncated to fit: R_AARCH64_LD64_GOTPAGE_LO15 against symbol `TransactionIdPrecedes' defined in .text section in access/transam/transam.o
commit_ts.c:(.text+0x14): warning: Too many GOT entries for -fpic, please recompile with -fPIC
/var/lib/buildbot/slaves/dave-builder/aarch64_generic/build/sdk/staging_dir/toolchain-aarch64_generic_gcc-7.3.0_musl/bin/../lib/gcc/aarch64-openwrt-linux-musl/7.3.0/../../../../aarch64-openwrt-linux-musl/bin/ld: final link failed: Symbol needs debug section which does not exist
collect2: error: ld returned 1 exit status
Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
Extend UCI mechanics to allow pre-populating a newly created
database by executing SQL statements from a scripts file.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* make sure contrib stuff gets built and installed
* refresh patches and improve Makefile while at it
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
As both LEDE and OpenWrt have STAGING_DIR_HOSTPKG now, we can start to rely
on it. See 73b7f55424 for more information on
STAGING_DIR_HOSTPKG.
STAGING_DIR_HOSTPKG won't actually be changed before the first LEDE release
(it is equivalent to $(STAGING_DIR)/host), so this simple search/replace
cleanup is safe to apply. Doing this cleanup now will be useful for the
Gluon project (an OpenWrt/LEDE based firmware framework) for experimenting
with modifying STAGING_DIR_HOSTPKG before doing this in the LEDE upstream.
Also fixes a typo in the dbus Makefile ("STAGIND_DIR").
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
Both postgresql-server and postgresql-cli install /usr/bin/psql which
thus creates a conflict when installing both packages.
Fix this by removing duplicate and useless binaries from the
postgresql-server package.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* convert package build to use host-build for ecpg, pg_config and zic
* introduce /lib/functions/postgresql.sh to be used by packages
requiring a postgres database to exist as well as postgres' init
* no longer require shadow-su, patch pg_ctl to setuid() ifself instead
* auto-create database directory if there is enough free space
* auto-create databases configured in UCI
* remove some dead uci config options
* grab maintainership
Signed-off-by: Daniel Golle <daniel@makrotopia.org>