71 lines
2.0 KiB
Django/Jinja
71 lines
2.0 KiB
Django/Jinja
[supervisord]
|
|
logfile_maxbytes=1MB
|
|
logfile_backups=2
|
|
nodaemon=true
|
|
|
|
[eventlistener:dependent-startup]
|
|
command=python3 -m supervisord_dependent_startup
|
|
autostart=true
|
|
autorestart=unexpected
|
|
startretries=0
|
|
exitcodes=0,3
|
|
events=PROCESS_STATE
|
|
buffer_size=1024
|
|
|
|
[eventlistener:supervisor-proc-exit-listener]
|
|
command=/usr/bin/supervisor-proc-exit-listener --container-name dhcp_relay
|
|
events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING
|
|
autostart=true
|
|
autorestart=unexpected
|
|
buffer_size=1024
|
|
|
|
[program:rsyslogd]
|
|
command=/usr/sbin/rsyslogd -n -iNONE
|
|
priority=1
|
|
autostart=false
|
|
autorestart=false
|
|
stdout_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 VLAN_INTERFACE %}
|
|
{# Count how many VLANs require a DHCP relay agent... #}
|
|
{% set ipv4_num_relays = { 'count': 0 } %}
|
|
{% set ipv6_num_relays = { 'count': 0 } %}
|
|
{% for vlan_name in VLAN_INTERFACE %}
|
|
{% if VLAN and vlan_name in VLAN and 'dhcp_servers' in VLAN[vlan_name] and VLAN[vlan_name]['dhcp_servers']|length > 0 %}
|
|
{% set _dummy = ipv4_num_relays.update({'count': ipv4_num_relays.count + 1}) %}
|
|
{% endif %}
|
|
{% if VLAN and vlan_name in VLAN and 'dhcpv6_servers' in VLAN[vlan_name] and VLAN[vlan_name]['dhcpv6_servers']|length > 0 %}
|
|
{% set _dummy = ipv6_num_relays.update({'count': ipv6_num_relays.count + 1}) %}
|
|
{% endif %}
|
|
{% endfor %}
|
|
{# If one or more of the VLANs require a DHCP relay agent... #}
|
|
{% if ipv4_num_relays.count > 0 or ipv6_num_relays.count > 0 %}
|
|
{% include 'dhcp-relay.programs.j2' %}
|
|
|
|
|
|
{# Create a program entry for each DHCP relay agent instance #}
|
|
{% set relay_for_ipv4 = { 'flag': False } %}
|
|
{% set relay_for_ipv6 = { 'flag': False } %}
|
|
{% for vlan_name in VLAN_INTERFACE %}
|
|
{% include 'dhcpv4-relay.agents.j2' %}
|
|
{% include 'dhcpv6-relay.agents.j2' %}
|
|
{% endfor %}
|
|
|
|
{% include 'dhcpv6-relay.monitors.j2' %}
|
|
{% endif %}
|
|
{% endif %}
|