mirror of
https://github.com/postgresml/pgcat.git
synced 2026-03-22 17:06:29 +00:00
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.
14 lines
196 B
Bash
14 lines
196 B
Bash
#!/bin/bash
|
|
set -e
|
|
|
|
systemctl daemon-reload
|
|
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
|