diff options
| author | Robert <rgingras@mieweb.com> | 2025-02-10 10:51:12 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-10 10:51:12 -0500 |
| commit | f400eec4f40a814baba82f8a6d5755bdfd69f120 (patch) | |
| tree | 729d57c54de53bc7d2f97d436496dd636d5b4045 /src/conf_mode/system_host-name.py | |
| parent | a24d2f87fdde466625d9b6173657f07cf4401f30 (diff) | |
| parent | 41e9b8b362faedc0c20316255d59d7f90e848a4c (diff) | |
| download | vyos-1x-f400eec4f40a814baba82f8a6d5755bdfd69f120.tar.gz vyos-1x-f400eec4f40a814baba82f8a6d5755bdfd69f120.zip | |
Merge branch 'current' into T7095_vrf-fix
Diffstat (limited to 'src/conf_mode/system_host-name.py')
| -rwxr-xr-x | src/conf_mode/system_host-name.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/conf_mode/system_host-name.py b/src/conf_mode/system_host-name.py index 3f245f166..fef034d1c 100755 --- a/src/conf_mode/system_host-name.py +++ b/src/conf_mode/system_host-name.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# Copyright (C) 2018-2024 VyOS maintainers and contributors +# Copyright (C) 2018-2025 VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as @@ -23,6 +23,7 @@ import vyos.hostsd_client from vyos.base import Warning from vyos.config import Config from vyos.configdict import leaf_node_changed +from vyos.defaults import systemd_services from vyos.ifconfig import Section from vyos.template import is_ip from vyos.utils.process import cmd @@ -174,11 +175,13 @@ def apply(config): # Restart services that use the hostname if hostname_new != hostname_old: - call("systemctl restart rsyslog.service") + tmp = systemd_services['rsyslog'] + call(f'systemctl restart {tmp}') # If SNMP is running, restart it too if process_named_running('snmpd') and config['snmpd_restart_reqired']: - call('systemctl restart snmpd.service') + tmp = systemd_services['snmpd'] + call(f'systemctl restart {tmp}') return None |
