From 8d85d80a55c34029b22fdc3a093cffa5cf73b720 Mon Sep 17 00:00:00 2001 From: Kyle Carberry Date: Mon, 25 Apr 2022 21:09:11 -0500 Subject: [PATCH] fix: Use proper shutdown signal for systemd (#1179) Coder was being killed instantly, which caused builds to randomly fail! --- agent/agent.go | 4 ++-- coder.service | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/agent/agent.go b/agent/agent.go index bd2592eb5f..eefebc8b82 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -318,8 +318,8 @@ func (a *agent) handleSSHSession(session ssh.Session) error { executablePath = strings.ReplaceAll(executablePath, "\\", "/") cmd.Env = append(cmd.Env, fmt.Sprintf(`GIT_SSH_COMMAND=%s gitssh --`, executablePath)) // These prevent the user from having to specify _anything_ to successfully commit. - cmd.Env = append(cmd.Env, fmt.Sprintf(`GIT_COMMITTER_EMAIL=%s`, a.ownerEmail.Load())) - cmd.Env = append(cmd.Env, fmt.Sprintf(`GIT_COMMITTER_NAME=%s`, a.ownerUsername.Load())) + cmd.Env = append(cmd.Env, fmt.Sprintf(`GIT_AUTHOR_EMAIL=%s`, a.ownerEmail.Load())) + cmd.Env = append(cmd.Env, fmt.Sprintf(`GIT_AUTHOR_NAME=%s`, a.ownerUsername.Load())) // Load environment variables passed via the agent. // These should override all variables we manually specify. diff --git a/coder.service b/coder.service index 47e765b19f..a7ecfe642c 100644 --- a/coder.service +++ b/coder.service @@ -18,6 +18,7 @@ SecureBits=keep-caps AmbientCapabilities=CAP_IPC_LOCK CacheDirectory=coder CapabilityBoundingSet=CAP_SYSLOG CAP_IPC_LOCK CAP_NET_BIND_SERVICE +KillSignal=SIGINT NoNewPrivileges=yes ExecStart=/usr/bin/coder server Restart=on-failure