summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2026-05-08 23:46:36 +0200
committerChristian Breunig <christian@breunig.cc>2026-05-14 08:13:52 +0200
commit6df7ca2f61ce1aa8352e8dbb1fc6e9c5d6d42937 (patch)
tree7f51bf751141c8733f5202dd711be0cc8a1e83bf /src
parentbdd0ed181e7b6515398462abc07390dabb50b68e (diff)
downloadvyos-1x-6df7ca2f61ce1aa8352e8dbb1fc6e9c5d6d42937.tar.gz
vyos-1x-6df7ca2f61ce1aa8352e8dbb1fc6e9c5d6d42937.zip
T8831: smoketests: irregular PermissionError caused by systemctl stop
Failures appear during PPPoEIf.remove() -> flush_addrs() -> set_dhcpv6(False), where disable uses self._cmd(f'systemctl stop ...'), which raises on any non-zero exit code of cmd(). PermissionError: [Errno 1] is misleading: cmd() raises OSError(exit_code, feedback); exit code 1 maps to PermissionError in Python 3, so logs point at "permissions" while the real signal is systemctl stop returned 1 (job failure, timeout, restart contention with Restart=always on dhcp6c@.service. Add a small systemd teardown helper stop_systemd_unit() validating the return codes from the "systemctl stop" calls.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/services/vyos-netlinkd5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/services/vyos-netlinkd b/src/services/vyos-netlinkd
index c759ebd3d..7bf6b8cce 100755
--- a/src/services/vyos-netlinkd
+++ b/src/services/vyos-netlinkd
@@ -32,6 +32,7 @@ from vyos.utils.commit import commit_in_progress
from vyos.utils.dict import dict_search
from vyos.utils.process import cmd
from vyos.utils.process import is_systemd_service_active
+from vyos.utils.process import stop_systemd_unit
running = True
@@ -62,10 +63,10 @@ def _handle_dhcp_events(operstate: Optional[str], ifname: str) -> None:
# Interface moved state to down
if is_systemd_service_active(systemdV4_service):
syslog.syslog(syslog.LOG_DEBUG, f'Stopping {systemdV4_service}...')
- cmd(f'systemctl stop {systemdV4_service}')
+ stop_systemd_unit(systemdV4_service, raise_on_failure=False)
if is_systemd_service_active(systemdV6_service):
syslog.syslog(syslog.LOG_DEBUG, f'Stopping {systemdV6_service}...')
- cmd(f'systemctl stop {systemdV6_service}')
+ stop_systemd_unit(systemdV6_service, raise_on_failure=False)
elif operstate == 'UP':
v6_restart = False