Skip to content

Commit da71606

Browse files
committed
added configs to start haproxy on startup
1 parent bf689c9 commit da71606

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

postgres_startup.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,19 @@ sudo systemctl enable patroni.service
292292
echo "setup reboot script for patroni" >> /usr/local/startup.log
293293
echo "" >> /usr/local/startup.log
294294

295+
# prepare haproxy to restart after reboot
296+
sudo chmod 777 /etc/default/haproxy
297+
echo "ENABLED=1" >> /etc/default/haproxy
298+
echo "CONFIG=\"/usr/local/patroni-master/postgresha.cfg\"" >> /etc/default/haproxy
299+
sudo chmod 644 /etc/default/haproxy
300+
echo "setup reboot config for haproxy" >> /usr/local/startup.log
301+
echo "" >> /usr/local/startup.log
302+
303+
# start haproxy
304+
sudo haproxy -D -f /usr/local/patroni-master/postgresha.cfg
305+
echo "started haproxy" >> /usr/local/startup.log
306+
echo "" >> /usr/local/startup.log
307+
295308
# start patroni
296309
sudo systemctl start patroni.service
297310
echo "started patroni" >> /usr/local/startup.log

0 commit comments

Comments
 (0)