Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ctrl+C doesn't kill the container using podman attach with podman machine #16662

Closed
ikatyang opened this issue Nov 29, 2022 · 7 comments · Fixed by #16985
Closed

Ctrl+C doesn't kill the container using podman attach with podman machine #16662

ikatyang opened this issue Nov 29, 2022 · 7 comments · Fixed by #16985
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. macos MacOS (OSX) related remote Problem is in podman-remote

Comments

@ikatyang
Copy link

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

Cannot stop container attached by podman attach by pressing Ctrl+C

Similar to #14707 but for podman attach command

Steps to reproduce the issue:

  1. podman machine start

  2. podman run --rm -d --name test nginx

  3. podman attach test

  4. press ctrl+c

  5. podman ps --noheading

Describe the results you received:

6b6c34680a8f  docker.io/library/nginx:latest  nginx -g daemon o...  9 seconds ago  Up 9 seconds ago              test

Describe the results you expected:

(empty output)

Additional information you deem important (e.g. issue happens only occasionally):

It works as expected if 2. and 3. are replaced by podman run --rm -it nginx.

Output of podman version:

Client:       Podman Engine
Version:      4.3.1
API Version:  4.3.1
Go Version:   go1.18.8
Built:        Thu Nov 10 04:43:58 2022
OS/Arch:      darwin/arm64

Server:       Podman Engine
Version:      4.3.0
API Version:  4.3.0
Go Version:   go1.19.2
Built:        Fri Oct 21 16:09:21 2022
OS/Arch:      linux/arm64

Output of podman info:

host:
  arch: arm64
  buildahVersion: 1.28.0
  cgroupControllers:
  - cpu
  - io
  - memory
  - pids
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.1.4-3.fc37.aarch64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.4, commit: '
  cpuUtilization:
    idlePercent: 99.24
    systemPercent: 0.6
    userPercent: 0.16
  cpus: 4
  distribution:
    distribution: fedora
    variant: coreos
    version: "37"
  eventLogger: journald
  hostname: localhost.localdomain
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 1000000
    uidmap:
    - container_id: 0
      host_id: 501
      size: 1
    - container_id: 1
      host_id: 100000
      size: 1000000
  kernel: 6.0.7-301.fc37.aarch64
  linkmode: dynamic
  logDriver: journald
  memFree: 5595410432
  memTotal: 6191599616
  networkBackend: netavark
  ociRuntime:
    name: crun
    package: crun-1.6-2.fc37.aarch64
    path: /usr/bin/crun
    version: |-
      crun version 1.6
      commit: 18cf2efbb8feb2b2f20e316520e0fd0b6c41ef4d
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +LIBKRUN +YAJL
  os: linux
  remoteSocket:
    exists: true
    path: /run/user/501/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: true
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: true
  serviceIsRemote: true
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.2.0-5.fc37.aarch64
    version: |-
      slirp4netns version 1.2.0
      commit: 656041d45cfca7a4176f6b7eed9e4fe6c11e8383
      libslirp: 4.7.0
      SLIRP_CONFIG_VERSION_MAX: 4
      libseccomp: 2.5.3
  swapFree: 0
  swapTotal: 0
  uptime: 0h 13m 55.00s
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  volume:
  - local
registries:
  search:
  - docker.io
store:
  configFile: /var/home/core/.config/containers/storage.conf
  containerStore:
    number: 2
    paused: 0
    running: 0
    stopped: 2
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /var/home/core/.local/share/containers/storage
  graphRootAllocated: 68171051008
  graphRootUsed: 9159524352
  graphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Using metacopy: "false"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 9
  runRoot: /run/user/501/containers
  volumePath: /var/home/core/.local/share/containers/storage/volumes
version:
  APIVersion: 4.3.0
  Built: 1666339761
  BuiltTime: Fri Oct 21 16:09:21 2022
  GitCommit: ""
  GoVersion: go1.19.2
  Os: linux
  OsArch: linux/arm64
  Version: 4.3.0

Package info (e.g. output of rpm -q podman or apt list podman or brew info podman):

brew info podman
==> podman: stable 4.3.1 (bottled), HEAD
Tool for managing OCI containers and pods
https://podman.io/
/opt/homebrew/Cellar/podman/4.3.1 (185 files, 47.6MB) *
  Poured from bottle on 2022-11-29 at 12:47:46
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/podman.rb
License: Apache-2.0 and GPL-3.0-or-later
==> Dependencies
Build: go-md2man ✘, [email protected] ✘
Required: qemu ✔
==> Options
--HEAD
        Install HEAD version
==> Caveats
zsh completions have been installed to:
  /opt/homebrew/share/zsh/site-functions

To restart podman after an upgrade:
  brew services restart podman
Or, if you don't want/need a background service you can just run:
  /opt/homebrew/opt/podman/bin/podman system service --time=0
==> Analytics
install: 29,640 (30 days), 79,815 (90 days), 238,131 (365 days)
install-on-request: 27,177 (30 days), 75,512 (90 days), 232,844 (365 days)
build-error: 24 (30 days)

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide?

Yes

Additional environment details (AWS, VirtualBox, physical, etc.):

macOS Ventura 13.0.1

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Nov 29, 2022
@github-actions github-actions bot added macos MacOS (OSX) related remote Problem is in podman-remote labels Nov 29, 2022
@rhatdan
Copy link
Member

rhatdan commented Nov 30, 2022

Testing this locally on Linux, it seems to work correctly.

@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@rhatdan
Copy link
Member

rhatdan commented Jan 3, 2023

@ashley-cui could you confirm this works for you on a Mac?

@ashley-cui
Copy link
Member

Seems like a legitimate issue.

acui@Ashleys-Mini podman % podman ps
CONTAINER ID  IMAGE                           COMMAND               CREATED         STATUS             PORTS       NAMES
e91e0a763bf8  docker.io/library/nginx:latest  nginx -g daemon o...  17 seconds ago  Up 17 seconds ago              test

@rhatdan
Copy link
Member

rhatdan commented Jan 3, 2023

Might be a podman -remote versus podman issue?

@ashley-cui
Copy link
Member

Yep, looks like we have to plumb sig-proxy through the attach code as well. I'll give this a stab.

@rhatdan
Copy link
Member

rhatdan commented Jan 3, 2023

This worked for me.
diff.patch

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 5, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. macos MacOS (OSX) related remote Problem is in podman-remote
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants