diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-04-21 16:20:07 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-04-21 16:21:42 +0200 |
commit | 1cf5863b6434d7a2d311cdc4478833a9951d0e92 (patch) | |
tree | 76df2bf1451d1fa24148ea5b73fa23c70a80831d /src/conf_mode/host_name.py | |
parent | 8219d609aa2ac7879c4ffac7b6476b84ab61366c (diff) | |
download | vyos-1x-1cf5863b6434d7a2d311cdc4478833a9951d0e92.tar.gz vyos-1x-1cf5863b6434d7a2d311cdc4478833a9951d0e92.zip |
dns-forwarding: T2298: verify pdns path is exists
Diffstat (limited to 'src/conf_mode/host_name.py')
-rwxr-xr-x | src/conf_mode/host_name.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/conf_mode/host_name.py b/src/conf_mode/host_name.py index a669580ae..f181a7b35 100755 --- a/src/conf_mode/host_name.py +++ b/src/conf_mode/host_name.py @@ -164,10 +164,17 @@ def apply(config): if process_named_running('snmpd'): call('systemctl restart snmpd.service') - # restart pdns if it is used - ret = run('/usr/bin/rec_control --socket-dir=/run/powerdns ping') - if ret == 0: - call('systemctl restart pdns-recursor.service') + # restart pdns if it is used - we check for the control dir to not raise + # an exception on system startup + # + # File "/usr/lib/python3/dist-packages/vyos/configsession.py", line 128, in __run_command + # raise ConfigSessionError(output) + # vyos.configsession.ConfigSessionError: [ system domain-name vyos.io ] + # Fatal: Unable to generate local temporary file in directory '/run/powerdns': No such file or directory + if os.path.isdir('/run/powerdns'): + ret = run('/usr/bin/rec_control --socket-dir=/run/powerdns ping') + if ret == 0: + call('systemctl restart pdns-recursor.service') return None |