summaryrefslogtreecommitdiff
path: root/src/conf_mode/system_syslog.py
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2025-02-02 21:40:46 +0100
committerChristian Breunig <christian@breunig.cc>2025-02-04 18:09:39 +0100
commitcf7721f7d5345e484e0c57b643913d2353dca6f5 (patch)
tree48ba9586c45090d20a15f027840d41a6ecc70807 /src/conf_mode/system_syslog.py
parent29a7edaf871cbf77092308eab05cb750a9e74308 (diff)
downloadvyos-1x-cf7721f7d5345e484e0c57b643913d2353dca6f5.tar.gz
vyos-1x-cf7721f7d5345e484e0c57b643913d2353dca6f5.zip
defaults: T6989: provide single source of systemd services
Some systemd services are re-used over multiple configuration files. Keep a single source of the real systemd names and only reference them by dictionary keys.
Diffstat (limited to 'src/conf_mode/system_syslog.py')
-rwxr-xr-xsrc/conf_mode/system_syslog.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/conf_mode/system_syslog.py b/src/conf_mode/system_syslog.py
index 00c571ea9..414bd4b6b 100755
--- a/src/conf_mode/system_syslog.py
+++ b/src/conf_mode/system_syslog.py
@@ -21,6 +21,7 @@ from sys import exit
from vyos.base import Warning
from vyos.config import Config
from vyos.configverify import verify_vrf
+from vyos.defaults import systemd_services
from vyos.utils.network import is_addr_assigned
from vyos.utils.process import call
from vyos.template import render
@@ -33,6 +34,9 @@ airbag.enable()
rsyslog_conf = '/run/rsyslog/rsyslog.conf'
logrotate_conf = '/etc/logrotate.d/vyos-rsyslog'
+systemd_socket = 'syslog.socket'
+systemd_service = systemd_services['rsyslog']
+
def get_config(config=None):
if config:
conf = config
@@ -107,8 +111,6 @@ def generate(syslog):
return None
def apply(syslog):
- systemd_socket = 'syslog.socket'
- systemd_service = 'syslog.service'
if not syslog:
call(f'systemctl stop {systemd_service} {systemd_socket}')
return None