diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-04-15 22:03:09 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-04-15 22:03:09 +0200 |
commit | 16b2fc8fc4cae96f027e036f259c10dc793bf5e5 (patch) | |
tree | db6b6987e168137ed24c8fa8b6a15cabec096050 /src/conf_mode/snmp.py | |
parent | b5de1daab68d223174476f653f5a591c1e0e4de6 (diff) | |
download | vyos-1x-16b2fc8fc4cae96f027e036f259c10dc793bf5e5.tar.gz vyos-1x-16b2fc8fc4cae96f027e036f259c10dc793bf5e5.zip |
dns-forwarding: T2298: fix path to control file
After migrating PowerDNS to systemd and also its configuration files to a
volatile directory in commit 77d725f ("dns-forwarding: T2185: move configuration
files to volatile /run directory") the path for the control file has not
been altered and pushed to the client rec_control binary"
Diffstat (limited to 'src/conf_mode/snmp.py')
-rwxr-xr-x | src/conf_mode/snmp.py | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/src/conf_mode/snmp.py b/src/conf_mode/snmp.py index d654dcb84..7530da2dc 100755 --- a/src/conf_mode/snmp.py +++ b/src/conf_mode/snmp.py @@ -535,23 +535,9 @@ def apply(snmp): # start SNMP daemon call("systemctl restart snmpd.service") - # Passwords are not available immediately in the configuration file, - # after daemon startup - we wait until they have been processed by - # snmpd, which we see when a magic line appears in this file. - while True: - while not os.path.exists(config_file_user): - sleep(0.5) - - try: - with open(config_file_user, 'r') as f: - for line in f: - # Search for our magic string inside the file - if 'usmUser' in line: - break - except IOError: - continue - else: - break + while (call('systemctl -q is-active snmpd.service') != 0): + print("service not yet started") + sleep(0.5) # net-snmp is now regenerating the configuration file in the background # thus we need to re-open and re-read the file as the content changed. |