manage_service reports success whatever happened #3

Open
opened 2026-10-05 11:45:12 +00:00 by christianmanivong · 0 comments
Owner

manage_service() (system_mixin.py, /etc/init.d/{name} {action}) returns {"success": True, ...} without looking at the exit status. A failed start or a missing script therefore shows up in netOrk as done.

napalm-device-types 2.2.0 now does it differently in SystemdServicesMixin.manage_service (service_action_command / parse_action_result): the exit status is printed after the command, and only that status decides. procd is not systemd, so the mixin itself does not fit. The marker-and-status idea does, for example:

/etc/init.d/<name> <action> 2>&1; echo __SVC_RC=$?

parsed with parse_action_result.

`manage_service()` (`system_mixin.py`, `/etc/init.d/{name} {action}`) returns `{"success": True, ...}` without looking at the exit status. A failed start or a missing script therefore shows up in netOrk as done. napalm-device-types 2.2.0 now does it differently in `SystemdServicesMixin.manage_service` (`service_action_command` / `parse_action_result`): the exit status is printed after the command, and only that status decides. procd is not systemd, so the mixin itself does not fit. The marker-and-status idea does, for example: `/etc/init.d/<name> <action> 2>&1; echo __SVC_RC=$?` parsed with `parse_action_result`.
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: NAPALM/napalm-openwrt#3