summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/interfaces-vxlan.py8
-rwxr-xr-xsrc/conf_mode/ipsec-settings.py3
-rwxr-xr-xsrc/conf_mode/system-syslog.py13
-rwxr-xr-xsrc/conf_mode/vrrp.py6
4 files changed, 17 insertions, 13 deletions
diff --git a/src/conf_mode/interfaces-vxlan.py b/src/conf_mode/interfaces-vxlan.py
index 7f1ac6c31..efdc21f89 100755
--- a/src/conf_mode/interfaces-vxlan.py
+++ b/src/conf_mode/interfaces-vxlan.py
@@ -189,13 +189,13 @@ def apply(vxlan):
# configure ARP cache timeout in milliseconds
v.set_arp_cache_tmo(vxlan['ip_arp_cache_tmo'])
# configure ARP filter configuration
- v.set_arp_filter(bond['ip_disable_arp_filter'])
+ v.set_arp_filter(vxlan['ip_disable_arp_filter'])
# configure ARP accept
- v.set_arp_accept(bond['ip_enable_arp_accept'])
+ v.set_arp_accept(vxlan['ip_enable_arp_accept'])
# configure ARP announce
- v.set_arp_announce(bond['ip_enable_arp_announce'])
+ v.set_arp_announce(vxlan['ip_enable_arp_announce'])
# configure ARP ignore
- v.set_arp_ignore(bond['ip_enable_arp_ignore'])
+ v.set_arp_ignore(vxlan['ip_enable_arp_ignore'])
# Enable proxy-arp on this interface
v.set_proxy_arp(vxlan['ip_proxy_arp'])
diff --git a/src/conf_mode/ipsec-settings.py b/src/conf_mode/ipsec-settings.py
index aab3e9734..e80c6caf0 100755
--- a/src/conf_mode/ipsec-settings.py
+++ b/src/conf_mode/ipsec-settings.py
@@ -248,7 +248,8 @@ def generate(data):
write_ipsec_ra_conn(data)
append_ipsec_conf(data)
else:
- remove_confs(delim_ipsec_l2tp_begin, delim_ipsec_l2tp_end, ipsec_ra_conn_file)
+ if os.path.exists(ipsec_ra_conn_file):
+ remove_confs(delim_ipsec_l2tp_begin, delim_ipsec_l2tp_end, ipsec_ra_conn_file)
remove_confs(delim_ipsec_l2tp_begin, delim_ipsec_l2tp_end, ipsec_secrets_flie)
remove_confs(delim_ipsec_l2tp_begin, delim_ipsec_l2tp_end, ipsec_conf_flie)
diff --git a/src/conf_mode/system-syslog.py b/src/conf_mode/system-syslog.py
index 15533afab..2d47cc061 100755
--- a/src/conf_mode/system-syslog.py
+++ b/src/conf_mode/system-syslog.py
@@ -19,6 +19,7 @@
import sys
import os
import re
+import subprocess
import jinja2
from vyos.config import Config
@@ -313,15 +314,11 @@ def verify(c):
def apply(c):
- if not c and os.path.exists('/var/run/rsyslogd.pid'):
- os.system("sudo systemctl stop syslog.socket")
- os.system("sudo systemctl stop rsyslog")
- else:
- if not os.path.exists('/var/run/rsyslogd.pid'):
- os.system("sudo systemctl start rsyslog >/dev/null")
- else:
- os.system("sudo systemctl restart rsyslog >/dev/null")
+ if not c:
+ subprocess.call(['sudo', 'systemctl', 'stop', 'syslog'])
+ return 0
+ subprocess.call(['sudo', 'systemctl', 'restart', 'syslog'])
if __name__ == '__main__':
try:
diff --git a/src/conf_mode/vrrp.py b/src/conf_mode/vrrp.py
index d31be4cfb..1d8477769 100755
--- a/src/conf_mode/vrrp.py
+++ b/src/conf_mode/vrrp.py
@@ -37,6 +37,7 @@ config_tmpl = """
global_defs {
dynamic_interfaces
+ script_user root
}
{% for group in groups -%}
@@ -117,6 +118,10 @@ vrrp_instance {{ group.name }} {
{% if group.fault_script -%}
notify_fault "/usr/libexec/vyos/system/vrrp-script-wrapper.py --state fault --group {{ group.name }} --interface {{ group.interface }} {{ group.fault_script }}"
{% endif -%}
+
+ {% if group.stop_script -%}
+ notify_stop "/usr/libexec/vyos/system/vrrp-script-wrapper.py --state stop --group {{ group.name }} --interface {{ group.interface }} {{ group.stop_script }}"
+ {% endif -%}
}
{% endfor -%}
@@ -178,6 +183,7 @@ def get_config():
group["master_script"] = config.return_value("transition-script master")
group["backup_script"] = config.return_value("transition-script backup")
group["fault_script"] = config.return_value("transition-script fault")
+ group["stop_script"] = config.return_value("transition-script stop")
if config.exists("no-preempt"):
group["preempt"] = False