From 88b2afb19b6b93b325274fac59be85ed2ef6086f Mon Sep 17 00:00:00 2001 From: Sebastian Serth Date: Fri, 6 Sep 2024 16:07:01 +0200 Subject: [PATCH] Automatically start systemd service if config file is present (#800) Previously, upgrading the deb package stopped the service but didn't reenable it after a successful upgrade. This made upgrading the package more difficult and required a second step to restart the service. With this commit, the systemd service is automatically started when the default config file is present. --- postinst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/postinst b/postinst index 50138c2..520599a 100644 --- a/postinst +++ b/postinst @@ -7,3 +7,7 @@ systemctl enable pgcat if ! id pgcat 2> /dev/null; then useradd -s /usr/bin/false pgcat fi + +if [ -f /etc/pgcat.toml ]; then + systemctl start pgcat +fi