From d09b97afc7e404ce377810e4a8efe3b27d5c3f4a Mon Sep 17 00:00:00 2001 From: Tim Ross Date: Wed, 28 Jan 2026 10:41:35 -0500 Subject: [PATCH] fix agentless joining default restart command https://github.com/gravitational/teleport/pull/63011 missed that the output from systemctl show includes a trailing \n. Additionally, the teleport join openssh command now respects the -d flag and will produce debug logging if requested. --- lib/config/configuration.go | 5 +++++ lib/openssh/sshd.go | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/config/configuration.go b/lib/config/configuration.go index 03b78b121cf67..181bef014ff9c 100644 --- a/lib/config/configuration.go +++ b/lib/config/configuration.go @@ -2911,11 +2911,16 @@ func ConfigureOpenSSH(clf *CommandLineFlags, cfg *servicecfg.Config) error { lib.SetInsecureDevMode(clf.InsecureMode) // Apply command line --debug flag to override logger severity. + level := slog.LevelError if clf.Debug { cfg.SetLogLevel(slog.LevelDebug) + level = slog.LevelDebug cfg.Debug = clf.Debug } + // Ensure that the logging level is respected by the logger. + utils.InitLogger(utils.LoggingForDaemon, level) + if clf.AuthToken != "" { // store the value of the --token flag: cfg.SetToken(clf.AuthToken) diff --git a/lib/openssh/sshd.go b/lib/openssh/sshd.go index 4f40760e425d3..cdf5c5006ceab 100644 --- a/lib/openssh/sshd.go +++ b/lib/openssh/sshd.go @@ -284,7 +284,7 @@ func defaultRestart() error { } const activeService = "ActiveState=active" - if !bytes.Equal([]byte(activeService), out) { + if !bytes.Equal([]byte(activeService), bytes.TrimSpace(out)) { slog.DebugContext(context.Background(), "skipping inactive OpenSSH service", "service", service) continue }