Skip to content

Commit

Permalink
Merge pull request #655 from erikwilson/agent-systemd-notify
Browse files Browse the repository at this point in the history
Update agent to notify systemd
  • Loading branch information
erikwilson committed Jul 18, 2019
2 parents bb44211 + e1162c7 commit 61bdd85
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions pkg/cli/agent/agent.go
Expand Up @@ -8,12 +8,12 @@ import (
"strings"
"time"

"github.com/rancher/wrangler/pkg/signals"

systemd "github.com/coreos/go-systemd/daemon"
"github.com/rancher/k3s/pkg/agent"
"github.com/rancher/k3s/pkg/cli/cmds"
"github.com/rancher/k3s/pkg/datadir"
"github.com/rancher/k3s/pkg/netutil"
"github.com/rancher/wrangler/pkg/signals"
"github.com/sirupsen/logrus"
"github.com/urfave/cli"
)
Expand Down Expand Up @@ -74,6 +74,7 @@ func Run(ctx *cli.Context) error {
cfg.Labels = append(cfg.Labels, "node-role.kubernetes.io/worker=true")

contextCtx := signals.SetupSignalHandler(context.Background())
systemd.SdNotify(true, "READY=1\n")

return agent.Run(contextCtx, cfg)
}
2 changes: 1 addition & 1 deletion pkg/cli/server/server.go
Expand Up @@ -194,7 +194,7 @@ func run(app *cli.Context, cfg *cmds.Server) error {
logrus.Info("k3s is up and running")
if notifySocket != "" {
os.Setenv("NOTIFY_SOCKET", notifySocket)
systemd.SdNotify(true, "READY=1")
systemd.SdNotify(true, "READY=1\n")
}

if cfg.DisableAgent {
Expand Down

0 comments on commit 61bdd85

Please sign in to comment.