File: startup_scripts.patch

package info (click to toggle)
patroni 4.0.6-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 4,708 kB
  • sloc: python: 28,942; sh: 565; makefile: 29
file content (66 lines) | stat: -rw-r--r-- 2,005 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
--- a/extras/startup-scripts/patroni
+++ b/extras/startup-scripts/patroni
@@ -18,7 +18,7 @@ USER="postgres"
 GROUP="postgres"
 
 NAME=patroni
-PATRONI="/opt/patroni/$NAME.py"
+PATRONI="/usr/bin/$NAME"
 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
     ;;
 
+  force-reload)
+    log_success_msg "Rorce-reloading Patroni configuration"
+    get_pid
+    kill -HUP $CHILDPID
+    ;;
+
   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}"
+    echo "Usage: /etc/init.d/$NAME {start|stop|restart|reload|force-reload|status}"
     exit 1
     ;;
 esac
--- a/extras/startup-scripts/patroni.service
+++ b/extras/startup-scripts/patroni.service
@@ -1,9 +1,7 @@
-# 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
+ConditionPathExists=/etc/patroni/config.yml
 
 [Service]
 Type=simple
@@ -17,17 +15,13 @@ 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=/home/sameuser
 
-# Where to send early-startup messages from the server
-# This is normally controlled by the global default set by systemd
-#StandardOutput=syslog
-
 # Pre-commands to start watchdog device
 # Uncomment if watchdog is part of your patroni setup
 #ExecStartPre=-/usr/bin/sudo /sbin/modprobe softdog
 #ExecStartPre=-/usr/bin/sudo /bin/chown postgres /dev/watchdog
 
 # Start the patroni process
-ExecStart=/bin/patroni /etc/patroni.yml
+ExecStart=/usr/bin/patroni /etc/patroni/config.yml
 
 # Send HUP to reload from patroni.yml
 ExecReload=/bin/kill -s HUP $MAINPID