summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Raiskup <praiskup@redhat.com>2014-09-18 16:20:37 +0200
committerPavel Raiskup <praiskup@redhat.com>2014-09-18 17:08:52 +0200
commit8ea2f32750a69d8b812f005293d5bfa50f08112e (patch)
tree802f67141a98a35ad7c77025ccd17724284d4089
parent0c4c172d6ed8bbb2bbfcf360244468a9ef51e3ed (diff)
downloadpostgresql-setup-prep-1.tar.gz
postgresql-setup-prep-1.tar.xz
postgresql-setup-prep-1.zip
postgresql-setup: detect systemd's NeedDaemonReloadprep-1
Because we rely on parsing of `systemctl show -p` outuput heavily, we need to detect whether the service file or some dropin did not change (or was not added). So from now we rather instruct admin to do daemon-reload when something changed.. * postgresql-setup.in: Detect the NeedDaemonReload and warn if yes. * NEWS: Document.
-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.