From 8ea2f32750a69d8b812f005293d5bfa50f08112e Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Thu, 18 Sep 2014 16:20:37 +0200 Subject: postgresql-setup: detect systemd's NeedDaemonReload 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. --- postgresql-setup.in | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'postgresql-setup.in') 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. -- cgit