summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2018-12-31 14:30:46 +0100
committerDaniil Baturin <daniil@baturin.org>2018-12-31 14:30:46 +0100
commit77d7e727faa5725735fd2b7742722a3f7f71d52f (patch)
treea29deba34f6ea07434886b2c86051cd45e40d04b /src/conf_mode
parentfc5f75c23fa3c7f93e982433705ab8971dbbabff (diff)
parentd50524722819582cc1d7ad289d12e9f585f701de (diff)
downloadvyos-1x-77d7e727faa5725735fd2b7742722a3f7f71d52f.tar.gz
vyos-1x-77d7e727faa5725735fd2b7742722a3f7f71d52f.zip
Merge branch 'current' into crux
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/host_name.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/conf_mode/host_name.py b/src/conf_mode/host_name.py
index 3b3958f7f..030735215 100755
--- a/src/conf_mode/host_name.py
+++ b/src/conf_mode/host_name.py
@@ -100,9 +100,13 @@ def apply(config):
"""Apply configuration"""
os.system("hostnamectl set-hostname --static {0}".format(config["fqdn"]))
- # restart services that use the hostname
+ # Restart services that use the hostname
os.system("systemctl restart rsyslog.service")
+ # If SNMP is running, restart it too
+ if os.system("pgrep snmpd > /dev/null") == 0:
+ os.system("systemctl restart snmpd.service")
+
return None