diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-04-13 19:05:44 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-04-13 19:05:44 +0200 |
commit | 77d725f11c049a6b4a761c25be2eeb34145201dc (patch) | |
tree | 43f6f938f6298e21840884606aef6ffa7e0f8a28 /src | |
parent | c89eb87446d40b753becd5441ec98e808c9a25b4 (diff) | |
download | vyos-1x-77d725f11c049a6b4a761c25be2eeb34145201dc.tar.gz vyos-1x-77d725f11c049a6b4a761c25be2eeb34145201dc.zip |
dns-forwarding: T2185: move configuration files to volatile /run directory
Diffstat (limited to 'src')
-rwxr-xr-x | src/conf_mode/dns_forwarding.py | 6 | ||||
-rw-r--r-- | src/etc/systemd/system/pdns-recursor.service.d/override.conf | 5 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/conf_mode/dns_forwarding.py b/src/conf_mode/dns_forwarding.py index fef1550ff..567dfa4b3 100755 --- a/src/conf_mode/dns_forwarding.py +++ b/src/conf_mode/dns_forwarding.py @@ -31,7 +31,7 @@ parser = argparse.ArgumentParser() parser.add_argument("--dhclient", action="store_true", help="Started from dhclient-script") -config_file = r'/etc/powerdns/recursor.conf' +config_file = r'/run/powerdns/recursor.conf' default_config_data = { 'allow_from': [], @@ -152,6 +152,10 @@ def generate(dns): if dns is None: return None + dirname = os.path.dirname(config_file) + if not os.path.exists(dirname): + os.mkdir(dirname) + render(config_file, 'dns-forwarding/recursor.conf.tmpl', dns, trim_blocks=True) return None diff --git a/src/etc/systemd/system/pdns-recursor.service.d/override.conf b/src/etc/systemd/system/pdns-recursor.service.d/override.conf new file mode 100644 index 000000000..602d7b774 --- /dev/null +++ b/src/etc/systemd/system/pdns-recursor.service.d/override.conf @@ -0,0 +1,5 @@ +[Service] +WorkingDirectory= +WorkingDirectory=/run/powerdns +ExecStart= +ExecStart=/usr/sbin/pdns_recursor --daemon=no --write-pid=no --disable-syslog --log-timestamp=no --config-dir=/run/powerdns |