Skip to content
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

Merged
merged 1 commit into from
Mar 19, 2018
Merged

Conversation

klizhentas
Copy link
Contributor

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.

@klizhentas klizhentas added this to the 2.5.3 "Portland" milestone Mar 18, 2018
@klizhentas klizhentas requested review from r0mant and russjones March 18, 2018 02:52
Copy link
Contributor

@russjones russjones left a 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.

@@ -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)
Copy link
Contributor

@russjones russjones Mar 19, 2018

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

continue after this line.

// 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() {
Copy link
Contributor

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.
@klizhentas klizhentas merged commit 1f464c7 into master Mar 19, 2018
@klizhentas klizhentas deleted the sasha/patch-fixes branch March 19, 2018 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

regular/sshserver.go errors after v2.4.2 -> v2.5.1 upgrade teleport start default output
3 participants