[docker-dhcp-relay]: use service dependency in supervisord to start services
This commit is contained in:
parent
448d1cdd49
commit
2e42a4ba0f
@ -3,27 +3,39 @@ logfile_maxbytes=1MB
|
|||||||
logfile_backups=2
|
logfile_backups=2
|
||||||
nodaemon=true
|
nodaemon=true
|
||||||
|
|
||||||
|
[eventlistener:dependent-startup]
|
||||||
|
command=python -m supervisord_dependent_startup
|
||||||
|
autostart=true
|
||||||
|
autorestart=unexpected
|
||||||
|
startretries=0
|
||||||
|
exitcodes=0,3
|
||||||
|
events=PROCESS_STATE
|
||||||
|
|
||||||
[eventlistener:supervisor-proc-exit-listener]
|
[eventlistener:supervisor-proc-exit-listener]
|
||||||
command=/usr/bin/supervisor-proc-exit-listener --container-name dhcp_relay
|
command=/usr/bin/supervisor-proc-exit-listener --container-name dhcp_relay
|
||||||
events=PROCESS_STATE_EXITED
|
events=PROCESS_STATE_EXITED
|
||||||
autostart=true
|
autostart=true
|
||||||
autorestart=unexpected
|
autorestart=unexpected
|
||||||
|
|
||||||
[program:start.sh]
|
|
||||||
command=/usr/bin/start.sh
|
|
||||||
priority=1
|
|
||||||
autostart=true
|
|
||||||
autorestart=false
|
|
||||||
stdout_logfile=syslog
|
|
||||||
stderr_logfile=syslog
|
|
||||||
|
|
||||||
[program:rsyslogd]
|
[program:rsyslogd]
|
||||||
command=/usr/sbin/rsyslogd -n
|
command=/usr/sbin/rsyslogd -n -iNONE
|
||||||
priority=2
|
priority=1
|
||||||
autostart=false
|
autostart=false
|
||||||
autorestart=false
|
autorestart=false
|
||||||
stdout_logfile=syslog
|
stdout_logfile=syslog
|
||||||
stderr_logfile=syslog
|
stderr_logfile=syslog
|
||||||
|
dependent_startup=true
|
||||||
|
|
||||||
|
[program:start]
|
||||||
|
command=/usr/bin/start.sh
|
||||||
|
priority=2
|
||||||
|
autostart=false
|
||||||
|
autorestart=false
|
||||||
|
startsecs=0
|
||||||
|
stdout_logfile=syslog
|
||||||
|
stderr_logfile=syslog
|
||||||
|
dependent_startup=true
|
||||||
|
dependent_startup_wait_for=rsyslogd:running
|
||||||
|
|
||||||
{# If our configuration has VLANs... #}
|
{# If our configuration has VLANs... #}
|
||||||
{% if VLAN %}
|
{% if VLAN %}
|
||||||
@ -81,6 +93,8 @@ autostart=false
|
|||||||
autorestart=false
|
autorestart=false
|
||||||
stdout_logfile=syslog
|
stdout_logfile=syslog
|
||||||
stderr_logfile=syslog
|
stderr_logfile=syslog
|
||||||
|
dependent_startup=true
|
||||||
|
dependent_startup_wait_for=start:exited
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -128,6 +142,8 @@ autostart=false
|
|||||||
autorestart=false
|
autorestart=false
|
||||||
stdout_logfile=syslog
|
stdout_logfile=syslog
|
||||||
stderr_logfile=syslog
|
stderr_logfile=syslog
|
||||||
|
dependent_startup=true
|
||||||
|
dependent_startup_wait_for=isc-dhcp-relay-{{ vlan_name }}:running
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -1,11 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Remove stale rsyslog PID file if it exists
|
|
||||||
rm -f /var/run/rsyslogd.pid
|
|
||||||
|
|
||||||
# Start rsyslog
|
|
||||||
supervisorctl start rsyslogd
|
|
||||||
|
|
||||||
# If our supervisor config has entries in the "isc-dhcp-relay" group...
|
# If our supervisor config has entries in the "isc-dhcp-relay" group...
|
||||||
if [ $(supervisorctl status | grep -c "^isc-dhcp-relay:") -gt 0 ]; then
|
if [ $(supervisorctl status | grep -c "^isc-dhcp-relay:") -gt 0 ]; then
|
||||||
# Wait for all interfaces to come up and be assigned IPv4 addresses before
|
# Wait for all interfaces to come up and be assigned IPv4 addresses before
|
||||||
@ -15,13 +9,4 @@ if [ $(supervisorctl status | grep -c "^isc-dhcp-relay:") -gt 0 ]; then
|
|||||||
# relay agent starts, it will not listen or send on that interface for the
|
# relay agent starts, it will not listen or send on that interface for the
|
||||||
# lifetime of the process.
|
# lifetime of the process.
|
||||||
/usr/bin/wait_for_intf.sh
|
/usr/bin/wait_for_intf.sh
|
||||||
|
|
||||||
# Start all DHCP relay agent(s)
|
|
||||||
supervisorctl start isc-dhcp-relay:*
|
|
||||||
fi
|
|
||||||
|
|
||||||
# If our supervisor config has entries in the "dhcpmon" group...
|
|
||||||
if [ $(supervisorctl status | grep -c "^dhcpmon:") -gt 0 ]; then
|
|
||||||
# Start all DHCP Monitor daemon(s)
|
|
||||||
supervisorctl start dhcpmon:*
|
|
||||||
fi
|
fi
|
||||||
|
@ -3,27 +3,39 @@ logfile_maxbytes=1MB
|
|||||||
logfile_backups=2
|
logfile_backups=2
|
||||||
nodaemon=true
|
nodaemon=true
|
||||||
|
|
||||||
|
[eventlistener:dependent-startup]
|
||||||
|
command=python -m supervisord_dependent_startup
|
||||||
|
autostart=true
|
||||||
|
autorestart=unexpected
|
||||||
|
startretries=0
|
||||||
|
exitcodes=0,3
|
||||||
|
events=PROCESS_STATE
|
||||||
|
|
||||||
[eventlistener:supervisor-proc-exit-listener]
|
[eventlistener:supervisor-proc-exit-listener]
|
||||||
command=/usr/bin/supervisor-proc-exit-listener --container-name dhcp_relay
|
command=/usr/bin/supervisor-proc-exit-listener --container-name dhcp_relay
|
||||||
events=PROCESS_STATE_EXITED
|
events=PROCESS_STATE_EXITED
|
||||||
autostart=true
|
autostart=true
|
||||||
autorestart=unexpected
|
autorestart=unexpected
|
||||||
|
|
||||||
[program:start.sh]
|
|
||||||
command=/usr/bin/start.sh
|
|
||||||
priority=1
|
|
||||||
autostart=true
|
|
||||||
autorestart=false
|
|
||||||
stdout_logfile=syslog
|
|
||||||
stderr_logfile=syslog
|
|
||||||
|
|
||||||
[program:rsyslogd]
|
[program:rsyslogd]
|
||||||
command=/usr/sbin/rsyslogd -n
|
command=/usr/sbin/rsyslogd -n -iNONE
|
||||||
priority=2
|
priority=1
|
||||||
autostart=false
|
autostart=false
|
||||||
autorestart=false
|
autorestart=false
|
||||||
stdout_logfile=syslog
|
stdout_logfile=syslog
|
||||||
stderr_logfile=syslog
|
stderr_logfile=syslog
|
||||||
|
dependent_startup=true
|
||||||
|
|
||||||
|
[program:start]
|
||||||
|
command=/usr/bin/start.sh
|
||||||
|
priority=2
|
||||||
|
autostart=false
|
||||||
|
autorestart=false
|
||||||
|
startsecs=0
|
||||||
|
stdout_logfile=syslog
|
||||||
|
stderr_logfile=syslog
|
||||||
|
dependent_startup=true
|
||||||
|
dependent_startup_wait_for=rsyslogd:running
|
||||||
|
|
||||||
[group:isc-dhcp-relay]
|
[group:isc-dhcp-relay]
|
||||||
programs=isc-dhcp-relay-Vlan1000
|
programs=isc-dhcp-relay-Vlan1000
|
||||||
@ -35,6 +47,8 @@ autostart=false
|
|||||||
autorestart=false
|
autorestart=false
|
||||||
stdout_logfile=syslog
|
stdout_logfile=syslog
|
||||||
stderr_logfile=syslog
|
stderr_logfile=syslog
|
||||||
|
dependent_startup=true
|
||||||
|
dependent_startup_wait_for=start:exited
|
||||||
|
|
||||||
|
|
||||||
[group:dhcpmon]
|
[group:dhcpmon]
|
||||||
@ -47,6 +61,8 @@ autostart=false
|
|||||||
autorestart=false
|
autorestart=false
|
||||||
stdout_logfile=syslog
|
stdout_logfile=syslog
|
||||||
stderr_logfile=syslog
|
stderr_logfile=syslog
|
||||||
|
dependent_startup=true
|
||||||
|
dependent_startup_wait_for=isc-dhcp-relay-Vlan1000:running
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user