Skip to content

Commit 8d85d80

Browse files
authored
fix: Use proper shutdown signal for systemd (#1179)
Coder was being killed instantly, which caused builds to randomly fail!
1 parent 744a00a commit 8d85d80

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

agent/agent.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,8 @@ func (a *agent) handleSSHSession(session ssh.Session) error {
318318
executablePath = strings.ReplaceAll(executablePath, "\\", "/")
319319
cmd.Env = append(cmd.Env, fmt.Sprintf(`GIT_SSH_COMMAND=%s gitssh --`, executablePath))
320320
// These prevent the user from having to specify _anything_ to successfully commit.
321-
cmd.Env = append(cmd.Env, fmt.Sprintf(`GIT_COMMITTER_EMAIL=%s`, a.ownerEmail.Load()))
322-
cmd.Env = append(cmd.Env, fmt.Sprintf(`GIT_COMMITTER_NAME=%s`, a.ownerUsername.Load()))
321+
cmd.Env = append(cmd.Env, fmt.Sprintf(`GIT_AUTHOR_EMAIL=%s`, a.ownerEmail.Load()))
322+
cmd.Env = append(cmd.Env, fmt.Sprintf(`GIT_AUTHOR_NAME=%s`, a.ownerUsername.Load()))
323323

324324
// Load environment variables passed via the agent.
325325
// These should override all variables we manually specify.

coder.service

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ SecureBits=keep-caps
1818
AmbientCapabilities=CAP_IPC_LOCK
1919
CacheDirectory=coder
2020
CapabilityBoundingSet=CAP_SYSLOG CAP_IPC_LOCK CAP_NET_BIND_SERVICE
21+
KillSignal=SIGINT
2122
NoNewPrivileges=yes
2223
ExecStart=/usr/bin/coder server
2324
Restart=on-failure

0 commit comments

Comments
 (0)