summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Raiskup <praiskup@redhat.com>2014-09-18 16:19:54 +0200
committerPavel Raiskup <praiskup@redhat.com>2014-09-18 17:08:42 +0200
commit0c4c172d6ed8bbb2bbfcf360244468a9ef51e3ed (patch)
tree8b36ef6999c5ae80931181cc5871a49fcbdb8299
parent78103f138136922d3e568a68e911aa097632bb58 (diff)
downloadpostgresql-setup-0c4c172d6ed8bbb2bbfcf360244468a9ef51e3ed.tar.gz
postgresql-setup-0c4c172d6ed8bbb2bbfcf360244468a9ef51e3ed.tar.xz
postgresql-setup-0c4c172d6ed8bbb2bbfcf360244468a9ef51e3ed.zip
postgresql-setup: leftovers, user feeling
* postgresql-setup.in (USAGE_STRING): Mention --port option. (initdb): Mention in info output the non-standard port, when used. * postgresql-setup.in: Do not throw the default-port message always, remved remaining sysconfig leftover. * NEWS: Mention that env files are now supported.
-rw-r--r--NEWS4
-rw-r--r--postgresql-setup.in17
2 files changed, 14 insertions, 7 deletions
diff --git a/NEWS b/NEWS
index 8949f01..b49039b 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,10 @@ New in 0.9.2 version
http://www.spinics.net/lists/fedora-devel/msg200450.html . We encourage
users to configure via postgresql.service.d/ drop-in directory.
+* postgresql-setup is now able to (the very ugly way, though) to read
+ environment variable setup from systemd's environment files specified
+ via EnvironmentFile= statement (reminded by private rhbz#1135611).
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
New in 0.9.1 version
diff --git a/postgresql-setup.in b/postgresql-setup.in
index ddefea1..bd47f98 100644
--- a/postgresql-setup.in
+++ b/postgresql-setup.in
@@ -27,8 +27,6 @@ README_DIST=@README_DIST@
# Home directory of postgres user
POSTGRES_HOMEDIR=@POSTGRES_HOMEDIR@
-SYSCONFIG_DIR=@PKGCONFIG_DIR@
-
SU=@SU@
# The where PostgreSQL server listens by default
@@ -54,6 +52,8 @@ to $PGMAJORVERSION).
Options:
--unit unit ID of PostgreSQL to run against
+ --port port where the server will listen for connections
+
--help show this help
--version show version of this package
--debug show basic debugging information
@@ -147,9 +147,13 @@ initdb()
error $"Data directory $pgdata is not empty!"
script_result=1
else
- info $"Initializing database in $pgdata."
+ port_info=
+ test "$pgport" != "$PGPORT_DEF" \
+ && port_info=$", listening on port '$pgport'"
+
+ info $"Initializing database in '$pgdata'$port_info"
if perform_initdb; then
- info $"Initialized, logs are in ${initdb_log}."
+ info $"Initialized, logs are in ${initdb_log}"
else
error $"Initializing database failed, see $initdb_log"
script_result=1
@@ -496,14 +500,13 @@ test "$option_mode" = upgrade -a "$pgport" = default \
# This is mostly for 'initdb'. We assume that the default port is $PGPORT_DEF
# if not set explicitly (only for default service name 'postgresql').
if test "$pgport" = default -a $option_service == postgresql; then
- info $"Using the default port '$PGPORT_DEF'."
+ debug $"Using the default port '$PGPORT_DEF'"
pgport=$PGPORT_DEF
fi
test "$pgport" = default \
&& die $"\
-Port is not set by postgresql.conf, '$SYSCONFIG_DIR/$option_service' \
-nor by --port."
+Port is not set by postgresql.conf nor by --port."
# These variables are read by underlying utilites, rather export them.
export PGDATA=$pgdata