Open network-shark opened 2 years ago
@network-shark Thanks for the report. Do you see the same results with the logging if you're not using runas
?
@garethgreenaway Luckily the error still occurs . If I run the command without runas like this .
unbound# salt-call cmd.run "pkg info | head -5" -l trace
The output is normal and not mixed up.
I thought a bit about it and compared the my environments . root / unbound
The Problem is that I can't run a shell with the unbound user .
unbound:*:59:59:Unbound DNS Resolver:/var/unbound:/usr/sbin/nologin
It is silly what I did there , but maybe this should throw an error and I still think the output should not mix up.
What seems to be happening here is that Salt is printing output before the logging system has had time to flush(and print) all the log messages, in particular, because the TRACE log level is being asked.
Fixing this would require some changes on Salt's CLI to make sure that the logging system is completely shutdown before anything is printed.
Also, if you need "clean" output, Salt prints to stdout
while logging prints to stderr
. Try just to capture stdout
.
Description When I use cmd.run 'X' runas=$user -ltrace the command is executed , but additionally the output got some lines from the debug.
Setup (Please provide relevant configs and/or SLS files (be sure to remove sensitive info. There is no general set-up of Salt.)
Please be as specific as possible and give set-up details.
Steps to Reproduce the behavior salt-call cmd.run "pkg info | head -5" runas=unbound -l trace
This looks odd
Expected behavior
Screenshots If applicable, add screenshots to help explain your problem.