2018-01-24 07:02:56 +01:00
|
|
|
Index: patroni/extras/startup-scripts/patroni
|
|
|
|
===================================================================
|
|
|
|
--- patroni.orig/extras/startup-scripts/patroni
|
|
|
|
+++ patroni/extras/startup-scripts/patroni
|
|
|
|
@@ -18,7 +18,7 @@ USER="postgres"
|
|
|
|
GROUP="postgres"
|
|
|
|
|
|
|
|
NAME=patroni
|
|
|
|
-PATRONI="/opt/patroni/$NAME.py"
|
2017-09-14 21:01:58 +02:00
|
|
|
+PATRONI="/usr/bin/$NAME"
|
2018-01-24 07:02:56 +01:00
|
|
|
PIDFILE="/var/run/$NAME.pid"
|
|
|
|
|
|
|
|
# Set this parameter, if you have several Postgres versions installed
|
|
|
|
@@ -114,6 +114,12 @@ case "$1" in
|
|
|
|
kill -HUP $CHILDPID
|
|
|
|
;;
|
|
|
|
|
2017-09-14 21:01:58 +02:00
|
|
|
+ force-reload)
|
|
|
|
+ log_success_msg "Rorce-reloading Patroni configuration"
|
|
|
|
+ get_pid
|
|
|
|
+ kill -HUP $CHILDPID
|
|
|
|
+ ;;
|
|
|
|
+
|
2018-01-24 07:02:56 +01:00
|
|
|
status)
|
|
|
|
get_pid
|
|
|
|
if start-stop-daemon -T --pid $CHILDPID; then
|
|
|
|
@@ -130,7 +136,7 @@ case "$1" in
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
|
|
|
- echo "Usage: /etc/init.d/$NAME {start|stop|restart|reload|status}"
|
2017-09-14 21:01:58 +02:00
|
|
|
+ echo "Usage: /etc/init.d/$NAME {start|stop|restart|reload|force-reload|status}"
|
2018-01-24 07:02:56 +01:00
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
Index: patroni/extras/startup-scripts/patroni.service
|
|
|
|
===================================================================
|
|
|
|
--- patroni.orig/extras/startup-scripts/patroni.service
|
|
|
|
+++ patroni/extras/startup-scripts/patroni.service
|
2018-09-28 12:20:08 +02:00
|
|
|
@@ -1,9 +1,7 @@
|
2017-09-14 21:01:58 +02:00
|
|
|
-# This is an example systemd config file for Patroni
|
|
|
|
-# You can copy it to "/etc/systemd/system/patroni.service",
|
|
|
|
-
|
|
|
|
[Unit]
|
|
|
|
Description=Runners to orchestrate a high-availability PostgreSQL
|
|
|
|
-After=syslog.target network.target
|
|
|
|
+After=network.target
|
2018-09-28 12:20:08 +02:00
|
|
|
+ConditionPathExists=/etc/patroni/config.yml
|
2017-09-14 21:01:58 +02:00
|
|
|
|
|
|
|
[Service]
|
|
|
|
Type=simple
|
2018-09-28 12:20:08 +02:00
|
|
|
@@ -16,11 +14,7 @@ EnvironmentFile=-/etc/patroni_env.conf
|
2018-09-21 11:18:33 +02:00
|
|
|
|
|
|
|
WorkingDirectory=~
|
2017-09-14 21:01:58 +02:00
|
|
|
|
|
|
|
-# Where to send early-startup messages from the server
|
|
|
|
-# This is normally controlled by the global default set by systemd
|
|
|
|
-# StandardOutput=syslog
|
|
|
|
-
|
|
|
|
-ExecStart=/bin/patroni /etc/patroni.yml
|
|
|
|
+ExecStart=/usr/bin/patroni /etc/patroni/config.yml
|
|
|
|
|
2018-09-21 11:18:33 +02:00
|
|
|
# Send HUP to reload from patroni.yml
|
|
|
|
ExecReload=/bin/kill -s HUP $MAINPID
|