Page MenuHomeVyOS Platform

Make vyos-configd relay stdout from scripts to the user's console
Closed, ResolvedPublic

Description

The vyos-configd client, vyshim, doesn't relay the stdout/stderr from scripts to the user's console. This is problematic because many scripts have used printing for displaying warnings or debug information.

We need to make sure everything scripts want to tell reaches the user who initiated the commit.

Details

Difficulty level
Unknown (require assessment)
Version
-
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Internal change (not visible to end users)

Event Timeline

dmbaturin triaged this task as Unbreak Now! priority.Feb 11 2021, 2:15 PM
dmbaturin created this task.
jestabro changed the task status from Open to In progress.Feb 17 2021, 2:06 AM

Currently, vyos-configd will explicitly report ConfigError to the console; however, non-fatal warnings or information will not be reported. An example of a non-fatal warning is:

https://github.com/vyos/vyos-1x/blob/current/src/conf_mode/service_pppoe-server.py#L63

Using the context managers redirect_stdout and redirect_stderr from contextlib allows a simple resolution. A link to this approach in testing is below.

One open issue is the absence of the component path, for example [ service pppoe-server ], in non-fatal warnings. This output is prepended by the backend, on interception of stdout, and has caused inconsistencies in the past, unrelated to vyos-configd --- cf. T2347.

Version in testing:
https://github.com/vyos/vyos-1x/compare/current...jestabro:T3302

jestabro changed the task status from In progress to Backport candidate.Feb 18 2021, 8:08 PM
jestabro moved this task from Need Triage to Finished on the VyOS 1.4 Sagitta board.
jestabro moved this task from Need Triage to In Progress on the VyOS 1.3 Equuleus board.
jestabro changed the task status from Backport candidate to Open.Feb 23 2021, 9:01 PM

If commit is not initiated from a 'live' session (for example, on boot), then redirected stdout/err should go to a file.

jestabro changed the task status from Open to Backport candidate.Feb 23 2021, 9:05 PM
jestabro reopened this task as Backport candidate.May 12 2021, 3:56 PM
jestabro added a project: VyOS 1.3 Equuleus.

This task was superseded by T3411, hence was not backported; however that missed the bug fix in the final commit. cherry-pick eeb9687.

jestabro moved this task from In Progress to Finished on the VyOS 1.3 Equuleus board.
SrividyaA set Issue type to Internal change (not visible to end users).Aug 31 2021, 11:17 AM