Commit graph

7 commits

Author SHA1 Message Date
Daniel Golle
f518cfb250
postgresql: improve init script
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>
2021-08-12 03:11:09 +01:00
Petr Štetiar
8383c19b90 treewide: fix service status command in procd compatible services
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>
2019-11-18 06:28:57 +01:00
Daniel Golle
c709189de4
postgresql: allow populating required DB using script
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>
2017-07-02 19:57:31 +02:00
Daniel Golle
ce46b633e2 postgresql: properly stop service
postmaster always detaches from procd, work around by using
pg_ctl to stop the server.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2016-10-11 01:03:27 +02:00
Daniel Golle
63120640e6 postgresql: update to version 9.5.4 and major rework
* 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>
2016-09-23 20:03:05 +02:00
Daniel Golle
714a408a6e postgresql: update source to 9.4.4 and refresh scripts
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2015-08-12 17:30:20 +02:00
Jo-Philipp Wich
022ce86177 postgresql: import from oldpackages, add myself as maintainer, add license information, update to v9.0.17
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2014-07-02 12:42:33 +02:00