kontainapp / km

Kontain Monitor
http://kontain.app
Apache License 2.0
29 stars 5 forks source link

crun: Review & decide on container logging #940

Open msterin opened 3 years ago

msterin commented 3 years ago

Review & decide on container logging (e.g ‘logs’ command - should we delegate to KM) Need to have better crun logging facilities, or if they are there understand how to turn on

johnmuth81 commented 2 years ago

I have no idea what this means, but I'm going to be doing some krun work so I'll take this and do something with it.

paulpopelka commented 2 years ago

This issue was raised as a result of my comments to Mark about the difficulty of tracing things in crun, especially when setting up the namespaces before forking the first process of the container. stderr is used by crun for its own purposes when it does the multiple forks required to setup namespaces. If you do trace to stderr during the namespace setup process strange things happen because the parent that did a fork is looking at the stderr from the child to decide if that phase of namespace creation succeeded. The debug tracing confuses the parent and all hell breaks loose. You start seeing things that worked before adding tracing now just fail.

The real big problem with tracing in crun is there is basically no debug tracing in the code. The debug logging primitive is there but is used very little.

I have some homebrew tracing code for crun that I resurrect whenever I need to work on crun. I am hesitant to check it in since if will never be going back to the parent repository.