Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions pkg/container/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,6 @@ func (c *container) SpecAddAnnotations(sb *sandbox.Sandbox, containerVolumes []o
if systemdHasCollectMode {
c.spec.AddAnnotation("org.systemd.property.CollectMode", "'inactive-or-failed'")
}
// Set systemd killmode to mixed so that only the main container process gets the SIGTERM
// This prevents issues with double signals to child processes inside the container
// when the main process propagates the signals down.
c.spec.AddAnnotation("org.systemd.property.KillMode", "'mixed'")
}

if configStopSignal != "" {
Expand Down
13 changes: 2 additions & 11 deletions server/sandbox_run_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -622,17 +622,8 @@ func (s *Server) runPodSandbox(ctx context.Context, req *pb.RunPodSandboxRequest
g.AddAnnotation("org.opencontainers.image.stopSignal", podContainer.Config.Config.StopSignal)
}

if s.config.CgroupManager().IsSystemd() {
if node.SystemdHasCollectMode() {
g.AddAnnotation("org.systemd.property.CollectMode", "'inactive-or-failed'")
}

// Set systemd killmode to mixed so that only the main container process gets the SIGTERM
// This prevents issues with double signals to child processes inside the container
// when the main process propagates the signals down.
if s.config.CgroupManager().IsSystemd() {
g.AddAnnotation("org.systemd.property.KillMode", "'mixed'")
}
if s.config.CgroupManager().IsSystemd() && node.SystemdHasCollectMode() {
g.AddAnnotation("org.systemd.property.CollectMode", "'inactive-or-failed'")
}

created := time.Now()
Expand Down