summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS4
-rw-r--r--postgresql-setup.in9
2 files changed, 13 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index b49039b..08bb40a 100644
--- a/NEWS
+++ b/NEWS
@@ -16,6 +16,10 @@ New in 0.9.2 version
environment variable setup from systemd's environment files specified
via EnvironmentFile= statement (reminded by private rhbz#1135611).
+* postgresql-setup now detects whether systemd configuration changed
+ while the `systemctl daemon-reload` was not done yet. Without
+ daemon-reload, running postgresql-setup could lead to unexpected results.
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
New in 0.9.1 version
diff --git a/postgresql-setup.in b/postgresql-setup.in
index bd47f98..bbb1863 100644
--- a/postgresql-setup.in
+++ b/postgresql-setup.in
@@ -515,6 +515,15 @@ export PGPORT=$pgport
debug "final pgdata: $pgdata"
debug "final pgport: $pgport"
+nr_option=NeedDaemonReload
+nr_out="`systemctl show -p $nr_option $option_service.service 2>/dev/null`"
+if [[ "$nr_out" != "$nr_option=no" ]]; then
+ error $"Note that systemd configuration for '$option_service' changed."
+ error_q $"You need to perform 'systemctl daemon-reload' otherwise the"
+ error_q $"results of this script can be inadequate."
+ exit 1
+fi
+
script_result=0
# See how we were called.