summaryrefslogtreecommitdiff
path: root/src/conf_mode/system_option.py
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-08-06 11:54:05 +0200
committerGitHub <noreply@github.com>2024-08-06 11:54:05 +0200
commit254ea4c805c6c6c404dc767e820c0661fe6524f3 (patch)
treedcbf6a9084a234288a034ddb116e1153a7400bab /src/conf_mode/system_option.py
parentacd27ebb5f80d7356d727742260d6c01d4ebce7a (diff)
parent8500e8658ff10f52739143fd7814cf60c9195f16 (diff)
downloadvyos-1x-254ea4c805c6c6c404dc767e820c0661fe6524f3.tar.gz
vyos-1x-254ea4c805c6c6c404dc767e820c0661fe6524f3.zip
Merge pull request #3945 from c-po/T3204-sysctl
sysctl: T3204: restore sysctl setttings overwritten by tuned
Diffstat (limited to 'src/conf_mode/system_option.py')
-rwxr-xr-xsrc/conf_mode/system_option.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/conf_mode/system_option.py b/src/conf_mode/system_option.py
index 180686924..402510492 100755
--- a/src/conf_mode/system_option.py
+++ b/src/conf_mode/system_option.py
@@ -31,7 +31,8 @@ from vyos.utils.process import cmd
from vyos.utils.process import is_systemd_service_running
from vyos.utils.network import is_addr_assigned
from vyos.utils.network import is_intf_addr_assigned
-from vyos.configdep import set_dependents, call_dependents
+from vyos.configdep import set_dependents
+from vyos.configdep import call_dependents
from vyos import ConfigError
from vyos import airbag
airbag.enable()
@@ -57,10 +58,9 @@ def get_config(config=None):
with_recursive_defaults=True)
if 'performance' in options:
- # Update IPv4 and IPv6 options after TuneD reapplies
- # sysctl from config files
- for protocol in ['ip', 'ipv6']:
- set_dependents(protocol, conf)
+ # Update IPv4/IPv6 and sysctl options after tuned applied it's settings
+ set_dependents('ip_ipv6', conf)
+ set_dependents('sysctl', conf)
return options
@@ -111,10 +111,11 @@ def generate(options):
def apply(options):
# System bootup beep
+ beep_service = 'vyos-beep.service'
if 'startup_beep' in options:
- cmd('systemctl enable vyos-beep.service')
+ cmd(f'systemctl enable {beep_service}')
else:
- cmd('systemctl disable vyos-beep.service')
+ cmd(f'systemctl disable {beep_service}')
# Ctrl-Alt-Delete action
if os.path.exists(systemd_action_file):