Skip to content

Commit

Permalink
restart patroni service if it crashed
Browse files Browse the repository at this point in the history
  • Loading branch information
vitabaks authored Aug 2, 2022
1 parent 48deb9d commit b56d504
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions roles/patroni/templates/patroni.service.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[Unit]
Description=Runners to orchestrate a high-availability PostgreSQL - patroni
Description=Runners to orchestrate a high-availability PostgreSQL - Patroni
After=syslog.target network.target

[Service]
Expand All @@ -11,6 +11,7 @@ Group=postgres
# Read in configuration file if it exists, otherwise proceed
EnvironmentFile=-/etc/patroni_env.conf

# The default is the user's home directory, and if you want to change it, you must provide an absolute path.
# WorkingDirectory=~

# Where to send early-startup messages from the server
Expand All @@ -32,14 +33,14 @@ ExecStart=/usr/bin/patroni /etc/patroni/patroni.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
# 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=60

# Do not restart the service if it crashes, we want to manually inspect database on failure
Restart=no
# Restart the service if it crashed
Restart=on-failure

[Install]
WantedBy=multi-user.target

0 comments on commit b56d504

Please sign in to comment.