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>
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>
* 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>