Directory restructuration
This commit is contained in:
parent
eb10288717
commit
b196905320
23 changed files with 127 additions and 166 deletions
|
|
@ -5,5 +5,5 @@
|
|||
0 2 * * * run-parts /etc/periodic/daily
|
||||
0 3 * * 6 run-parts /etc/periodic/weekly
|
||||
0 5 1 * * run-parts /etc/periodic/monthly
|
||||
* * * * * /haproxy-reload.sh
|
||||
* * * * * /scripts/haproxy-reload.sh
|
||||
|
||||
1
assets/etc/haproxy/conf.d/00-simple-comment.cfg
Normal file
1
assets/etc/haproxy/conf.d/00-simple-comment.cfg
Normal file
|
|
@ -0,0 +1 @@
|
|||
# Simple file include
|
||||
3
assets/etc/haproxy/conf.d/README.md
Normal file
3
assets/etc/haproxy/conf.d/README.md
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# Custom HAProxy
|
||||
|
||||
Put files .cfg to be included in the configuration
|
||||
|
|
@ -22,7 +22,7 @@ supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
|
|||
serverurl=unix:///dev/shm/supervisor.sock ; use a unix:// URL for a unix socket
|
||||
|
||||
[program:haproxy]
|
||||
command = /haproxy.sh
|
||||
command = /scripts/haproxy.sh
|
||||
autostart=true
|
||||
autorestart=false
|
||||
priority=5
|
||||
|
|
@ -41,5 +41,5 @@ stderr_logfile=/dev/stderr
|
|||
stderr_logfile_maxbytes=0
|
||||
|
||||
[eventlistener:exit_on_any_fatal]
|
||||
command=/exit-event-listener.py
|
||||
command=/scripts/exit-event-listener.py
|
||||
events=PROCESS_STATE_FATAL,PROCESS_STATE_EXITED,PROCESS_STATE_STOPPED
|
||||
18
assets/scripts/exit-event-listener.py
Executable file
18
assets/scripts/exit-event-listener.py
Executable file
|
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import signal
|
||||
|
||||
from supervisor import childutils
|
||||
|
||||
def main():
|
||||
while True:
|
||||
headers, payload = childutils.listener.wait()
|
||||
childutils.listener.ok()
|
||||
events = ['PROCESS_STATE_FATAL', 'PROCESS_STATE_EXITED', 'PROCESS_STATE_STOPPED']
|
||||
if not (headers['eventname'] in events):
|
||||
continue
|
||||
os.kill(os.getppid(), signal.SIGTERM)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
5
assets/scripts/haproxy-reload.sh
Executable file
5
assets/scripts/haproxy-reload.sh
Executable file
|
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
echo "Reloading..."
|
||||
|
||||
/usr/local/sbin/haproxy -W -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -x /var/run/haproxy.sock -sf $(cat /run/haproxy.pid) &
|
||||
7
assets/scripts/haproxy.sh
Executable file
7
assets/scripts/haproxy.sh
Executable file
|
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
/usr/local/sbin/haproxy -W -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -S /var/run/haproxy.sock
|
||||
|
||||
while true; do
|
||||
sleep 60
|
||||
done
|
||||
Loading…
Add table
Add a link
Reference in a new issue