diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-12-26 10:01:22 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-12-26 10:01:32 +0100 |
commit | de28cb2036af6e7786ff54f1732d3a33439442e8 (patch) | |
tree | f4da920b3bfdc7ba37c37c4174fd66644476d406 /src | |
parent | 3854031667c397412d04697509f02b097e401e9a (diff) | |
download | vyos-1x-de28cb2036af6e7786ff54f1732d3a33439442e8.tar.gz vyos-1x-de28cb2036af6e7786ff54f1732d3a33439442e8.zip |
flow-accounting: T4097: move configuration file to /run
Diffstat (limited to 'src')
-rwxr-xr-x | src/conf_mode/flow_accounting_conf.py | 6 | ||||
-rw-r--r-- | src/etc/systemd/system/uacctd.service.d/override.conf | 14 |
2 files changed, 18 insertions, 2 deletions
diff --git a/src/conf_mode/flow_accounting_conf.py b/src/conf_mode/flow_accounting_conf.py index 74d304493..e01f3066b 100755 --- a/src/conf_mode/flow_accounting_conf.py +++ b/src/conf_mode/flow_accounting_conf.py @@ -34,7 +34,7 @@ from vyos import ConfigError from vyos import airbag airbag.enable() -uacctd_conf_path = '/etc/pmacct/uacctd.conf' +uacctd_conf_path = '/run/pmacct/uacctd.conf' iptables_nflog_table = 'raw' iptables_nflog_chain = 'VYATTA_CT_PREROUTING_HOOK' egress_iptables_nflog_table = 'mangle' @@ -252,8 +252,10 @@ def apply(flow_config): _iptables_config([], 'ingress') _iptables_config([], 'egress') - # Stop flow-accounting daemon + # Stop flow-accounting daemon and remove configuration file cmd('systemctl stop uacctd.service') + if os.path.exists(uacctd_conf_path): + os.unlink(uacctd_conf_path) return # Start/reload flow-accounting daemon diff --git a/src/etc/systemd/system/uacctd.service.d/override.conf b/src/etc/systemd/system/uacctd.service.d/override.conf new file mode 100644 index 000000000..38bcce515 --- /dev/null +++ b/src/etc/systemd/system/uacctd.service.d/override.conf @@ -0,0 +1,14 @@ +[Unit] +After= +After=vyos-router.service +ConditionPathExists= +ConditionPathExists=/run/pmacct/uacctd.conf + +[Service] +EnvironmentFile= +ExecStart= +ExecStart=/usr/sbin/uacctd -f /run/pmacct/uacctd.conf +WorkingDirectory= +WorkingDirectory=/run/pmacct +PIDFile= +PIDFile=/run/pmacct/uacctd.pid |