* debian/patches/startup_scripts.patch: Split out patroni@.service into ...

* debian/patroni@.service: ... this.
  * debian/patroni.install: Adjusted.
This commit is contained in:
Michael Banck 2018-11-11 15:23:27 +01:00
parent 7793595535
commit 66706ec370
4 changed files with 48 additions and 50 deletions

5
debian/changelog vendored
View file

@ -1,6 +1,9 @@
patroni (1.5.1-3) UNRELEASED; urgency=medium
*
[ Michael Banck ]
* debian/patches/startup_scripts.patch: Split out patroni@.service into ...
* debian/patroni@.service: ... this.
* debian/patroni.install: Adjusted.
-- Debian PostgreSQL Maintainers <team+postgresql@tracker.debian.org> Sat, 10 Nov 2018 20:55:39 +0100

View file

@ -68,51 +68,3 @@ Index: patroni/extras/startup-scripts/patroni.service
# Send HUP to reload from patroni.yml
ExecReload=/bin/kill -s HUP $MAINPID
Index: patroni/extras/startup-scripts/patroni@.service
===================================================================
--- /dev/null
+++ patroni/extras/startup-scripts/patroni@.service
@@ -0,0 +1,43 @@
+# systemd service template for patroni instances. The actual instances will
+# be called "patroni@version-cluster", e.g. "patroni@10-main". The
+# variable %i expands to "version-cluster", %I expands to "version/cluster".
+# (%I breaks for cluster names containing dashes.)
+[Unit]
+Description=Patroni instance %i
+After=network.target
+ConditionPathExists=/etc/patroni/%i.yml
+
+[Service]
+Type=simple
+
+User=postgres
+Group=postgres
+
+# Read in configuration file if it exists, otherwise proceed
+EnvironmentFile=-/etc/patroni_env.conf
+
+PermissionsStartOnly=True
+WorkingDirectory=~
+RuntimeDirectory=postgresql/%i.pg_stat_tmp
+RuntimeDirectoryMode=2775
+
+ExecStart=/usr/bin/patroni /etc/patroni/%i.yml
+
+# Send HUP to reload from patroni.yml
+ExecReload=/bin/kill -s HUP $MAINPID
+
+# only kill the patroni process, not it's children, so it will gracefully stop postgres
+KillMode=process
+
+# Give a reasonable amount of time for the server to start up/shut down
+TimeoutSec=30
+
+# Do not restart the service if it crashes, we want to manually inspect database on failure
+Restart=no
+
+# Uncomment in order to get debugging output
+#Environment=PATRONI_LOGLEVEL=DEBUG
+
+[Install]
+WantedBy=multi-user.target
+

View file

@ -1,10 +1,10 @@
extras/startup-scripts/patroni etc/init.d
extras/startup-scripts/patroni.service lib/systemd/system
extras/startup-scripts/patroni@.service lib/systemd/system
debian/pg_clonecluster_patroni usr/share/patroni
debian/pg_createcluster_patroni usr/share/patroni
debian/pg_createconfig_patroni usr/bin
debian/dcs.yml etc/patroni
debian/config.yml.in etc/patroni
debian/patroni@.service lib/systemd/system
debian/tmp/usr/lib
debian/tmp/usr/bin

43
debian/patroni@.service vendored Normal file
View file

@ -0,0 +1,43 @@
# systemd service template for patroni instances. The actual instances will
# be called "patroni@version-cluster", e.g. "patroni@10-main". The
# variable %i expands to "version-cluster", %I expands to "version/cluster".
# (%I breaks for cluster names containing dashes.)
[Unit]
Description=Patroni instance %i
After=network.target
ConditionPathExists=/etc/patroni/%i.yml
[Service]
Type=simple
User=postgres
Group=postgres
# Read in configuration file if it exists, otherwise proceed
EnvironmentFile=-/etc/patroni_env.conf
PermissionsStartOnly=True
WorkingDirectory=~
RuntimeDirectory=postgresql/%i.pg_stat_tmp
RuntimeDirectoryMode=2775
ExecStart=/usr/bin/patroni /etc/patroni/%i.yml
# Send HUP to reload from patroni.yml
ExecReload=/bin/kill -s HUP $MAINPID
# only kill the patroni process, not it's children, so it will gracefully stop postgres
KillMode=process
# Give a reasonable amount of time for the server to start up/shut down
TimeoutSec=30
# Do not restart the service if it crashes, we want to manually inspect database on failure
Restart=no
# Uncomment in order to get debugging output
#Environment=PATRONI_LOGLEVEL=DEBUG
[Install]
WantedBy=multi-user.target