From ab331fab9e92a69e68080d413bf926db14ac354b Mon Sep 17 00:00:00 2001 From: Viacheslav Hletenko Date: Wed, 31 Jul 2024 15:25:47 +0000 Subject: T5657: Add VRF support for zabbix-agent To start the service under VRF requires starting under User=root otherwise it had issues with cgroups --- data/templates/zabbix-agent/10-override.conf.j2 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'data/templates') diff --git a/data/templates/zabbix-agent/10-override.conf.j2 b/data/templates/zabbix-agent/10-override.conf.j2 index 7c296e8fd..f6bd6500d 100644 --- a/data/templates/zabbix-agent/10-override.conf.j2 +++ b/data/templates/zabbix-agent/10-override.conf.j2 @@ -1,3 +1,4 @@ +{% set zabbix_command = 'ip vrf exec ' ~ vrf ~ ' ' if vrf is vyos_defined else '' %} [Unit] After= After=vyos-router.service @@ -5,9 +6,11 @@ ConditionPathExists= ConditionPathExists=/run/zabbix/zabbix-agent2.conf [Service] +User= +User=root EnvironmentFile= ExecStart= -ExecStart=/usr/sbin/zabbix_agent2 --config /run/zabbix/zabbix-agent2.conf --foreground +ExecStart={{ zabbix_command }}/usr/sbin/zabbix_agent2 --config /run/zabbix/zabbix-agent2.conf --foreground WorkingDirectory= WorkingDirectory=/run/zabbix Restart=always -- cgit v1.2.3