-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix logging, collect status of forked processes #1790
Conversation
5b148bd
to
b20e603
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of minor issues, otherwise looks good.
lib/service/service.go
Outdated
@@ -728,6 +733,8 @@ func (process *TeleportProcess) initAuthService() error { | |||
}) | |||
|
|||
process.RegisterFunc("auth.tls", func() error { | |||
utils.Consolef(cfg.Console, "[AUTH] Auth service is starting on %v.", cfg.Auth.SSHAddr.Addr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These log lines will be misaligned because they don't use the new component logger we have.
Should be easy to fix because utils.Consolf
just writes to a writer and then to the logs: https://github.com/gravitational/teleport/blob/v2.5.2/lib/utils/cli.go#L140-L148
var wait syscall.WaitStatus | ||
rpid, err := syscall.Wait4(pid, &wait, syscall.WNOHANG, nil) | ||
if err != nil { | ||
log.Errorf("Wait call failed: %v.", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
continue
after this line.
lib/service/signals.go
Outdated
// have tried to collect the status of this process. | ||
// Instead this logic tries to collect statuses of the processes | ||
// forked during restart procedure. | ||
func (process *TeleportProcess) collectStatuses() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment should start with collectStatuses
.
fixes #1785, fixes #1776 This commit fixes several issues with output: First teleport start now prints output matching quickstart guide and sets default console logging to ERROR. SIGCHLD handler now only collects processes PID forked during live restart to avoid confusing other wait calls that have no process status to collect any more.
b20e603
to
7d05c05
Compare
fixes #1785, fixes #1776
This commit fixes several issues with output:
First teleport start now prints output
matching quickstart guide and sets default
console logging to ERROR.
SIGCHLD handler now only collects
processes PID forked during live restart
to avoid confusing other wait calls that
have no process status to collect any more.