summaryrefslogtreecommitdiff
path: root/src/system
diff options
context:
space:
mode:
authorsarthurdev <965089+sarthurdev@users.noreply.github.com>2021-06-18 20:41:39 +0200
committersarthurdev <965089+sarthurdev@users.noreply.github.com>2021-06-19 17:02:44 +0200
commitd372734bfd2ec88df000f9cd943137057a823088 (patch)
treef5e507c9c7043d272875f64227474c1e3325c0c9 /src/system
parente5e3772eac3a646d2a0dec0cc7437ee9e364a26b (diff)
downloadvyos-1x-d372734bfd2ec88df000f9cd943137057a823088.tar.gz
vyos-1x-d372734bfd2ec88df000f9cd943137057a823088.zip
mdns: vrrp: T3635: Add ability to use mDNS repeater with VRRP
Diffstat (limited to 'src/system')
-rwxr-xr-xsrc/system/keepalived-fifo.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/system/keepalived-fifo.py b/src/system/keepalived-fifo.py
index 7e2076820..3b4330e9b 100755
--- a/src/system/keepalived-fifo.py
+++ b/src/system/keepalived-fifo.py
@@ -37,6 +37,8 @@ logs_handler_syslog.setFormatter(logs_format)
logger.addHandler(logs_handler_syslog)
logger.setLevel(logging.DEBUG)
+mdns_running_file = '/run/mdns_vrrp_active'
+mdns_update_command = 'sudo /usr/libexec/vyos/conf_mode/service_mdns-repeater.py'
# class for all operations
class KeepalivedFifo:
@@ -121,6 +123,9 @@ class KeepalivedFifo:
logger.info("{} {} changed state to {}".format(n_type, n_name, n_state))
# check and run commands for VRRP instances
if n_type == 'INSTANCE':
+ if os.path.exists(mdns_running_file):
+ cmd(mdns_update_command)
+
if n_name in self.vrrp_config['vrrp_groups'] and n_state in self.vrrp_config['vrrp_groups'][n_name]:
n_script = self.vrrp_config['vrrp_groups'][n_name].get(n_state)
if n_script:
@@ -128,6 +133,9 @@ class KeepalivedFifo:
# check and run commands for VRRP sync groups
# currently, this is not available in VyOS CLI
if n_type == 'GROUP':
+ if os.path.exists(mdns_running_file):
+ cmd(mdns_update_command)
+
if n_name in self.vrrp_config['sync_groups'] and n_state in self.vrrp_config['sync_groups'][n_name]:
n_script = self.vrrp_config['sync_groups'][n_name].get(n_state)
if n_script: