From 151f851502c8f7ec09d411a8a81452f7a7d64042 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sun, 14 May 2023 11:42:21 +0000 Subject: T5224: Fix `del system syslog` os.unlink() is the correct function: Traceback (most recent call last): File "/usr/libexec/vyos/conf_mode/system-syslog.py", line 146, in generate(c) File "/usr/libexec/vyos/conf_mode/system-syslog.py", line 114, in generate os.path.unlink(rsyslog_conf) ^^^^^^^^^^^^^^ AttributeError: module 'posixpath' has no attribute 'unlink' Signed-off-by: Joe Groocock --- src/conf_mode/system-syslog.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/conf_mode/system-syslog.py') diff --git a/src/conf_mode/system-syslog.py b/src/conf_mode/system-syslog.py index e646fb0ae..4995ccb40 100755 --- a/src/conf_mode/system-syslog.py +++ b/src/conf_mode/system-syslog.py @@ -111,9 +111,9 @@ def verify(syslog): def generate(syslog): if not syslog: if os.path.exists(rsyslog_conf): - os.path.unlink(rsyslog_conf) + os.unlink(rsyslog_conf) if os.path.exists(logrotate_conf): - os.path.unlink(logrotate_conf) + os.unlink(logrotate_conf) return None -- cgit v1.2.3 From 85b7b4fea9a5e9fdcfe138ec1f1816594fee70ea Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sun, 14 May 2023 12:50:33 +0100 Subject: T5224: Stop syslog.socket alongside syslog.service Avoids the following warning, and any external service from re-activating syslog via systemd socket activation: frebib@vyos# commit [ system syslog ] DEBUG/COMMAND returned (err): Warning: Stopping syslog.service, but it can still be activated by: syslog.socket DEBUG/COMMAND cmd 'systemctl stop syslog.service' Signed-off-by: Joe Groocock --- src/conf_mode/system-syslog.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/conf_mode/system-syslog.py') diff --git a/src/conf_mode/system-syslog.py b/src/conf_mode/system-syslog.py index 4995ccb40..cf34bad2e 100755 --- a/src/conf_mode/system-syslog.py +++ b/src/conf_mode/system-syslog.py @@ -126,9 +126,10 @@ 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}') + call(f'systemctl stop {systemd_service} {systemd_socket}') return None # we need to restart the service if e.g. the VRF name changed -- cgit v1.2.3