Skip to content

Commit

Permalink
Merge pull request #3177 from apostasie/dev-kill
Browse files Browse the repository at this point in the history
Make systemctl happy by not passing an explicit signal for kill
  • Loading branch information
AkihiroSuda authored Jul 5, 2024
2 parents 80635f8 + 1b96d8d commit 45e6d0b
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions pkg/testutil/testutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import (

"github.com/Masterminds/semver/v3"
"github.com/containerd/containerd/defaults"
"github.com/containerd/log"
"github.com/containerd/nerdctl/v2/pkg/buildkitutil"
"github.com/containerd/nerdctl/v2/pkg/imgutil"
"github.com/containerd/nerdctl/v2/pkg/infoutil"
Expand Down Expand Up @@ -153,7 +152,7 @@ func (b *Base) KillDaemon() {
b.T.Logf("killing %q", target)
cmdKill := exec.Command("systemctl",
append(b.systemctlArgs(),
[]string{"kill", "-s", "KILL", target}...)...)
[]string{"kill", target}...)...)
if out, err := cmdKill.CombinedOutput(); err != nil {
err = fmt.Errorf("cannot kill %q: %q: %w", target, string(out), err)
b.T.Fatal(err)
Expand Down Expand Up @@ -562,12 +561,6 @@ func GetEnableIPv6() bool {
}

func GetDaemonIsKillable() bool {
if flagTestKillDaemon && strings.HasPrefix(infoutil.DistroName(), "Ubuntu 24.04") { // FIXME: check systemd version, not distro
log.L.Warn("FIXME: Ignoring -test.kill-daemon: the flag does not seem to work on Ubuntu 24.04")
// > Failed to kill unit containerd.service: Failed to send signal SIGKILL to auxiliary processes: Invalid argument\n
// https://github.com/containerd/nerdctl/pull/3129#issuecomment-2185780506
return false
}
return flagTestKillDaemon
}

Expand Down

0 comments on commit 45e6d0b

Please sign in to comment.