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 run -i with podman machine #14707

Closed
ponimas opened this issue Jun 23, 2022 · 15 comments · Fixed by #15131
Closed

Ctrl+C doesn't kill the container using podman run -i with podman machine #14707

ponimas opened this issue Jun 23, 2022 · 15 comments · Fixed by #15131
Assignees
Labels
Good First Issue This issue would be a good issue for a first time contributor to undertake. 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

@ponimas
Copy link

ponimas commented Jun 23, 2022

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

/kind bug

Description

It's impossible to stop container attached to the terminal (flags -a, -i or -t) by pressing Ctrl+C.

Steps to reproduce the issue:

  1. podmain machine start

  2. podman run -i nginx

  3. press ctrl+c

  4. podman ps --noheading

Describe the results you received:

330f2d2ee822  docker.io/library/nginx:latest  nginx -g daemon o...  14 hours ago  Up 14 hours ago              wonderful_kowalevski

Describe the results you expected:

(empty output)

Additional information you deem important (e.g. issue happens only occasionally):
Created and Status in docker ps output are suspicious. They say 14 hours despite the fact that container is several seconds old.

➜  ~ podman run -i --log-level=debug nginx
INFO[0000] podman filtering at log level debug          
DEBU[0000] Called run.PersistentPreRunE(podman run -i --log-level=debug nginx) 
DEBU[0000] SSH Ident Key "/Users/ponimas/.ssh/podman-machine-default" SHA256:tOvATDNZzT3jTcmqxc4SrKQnIicNP17+MTCNpfV3FIk ssh-ed25519 
DEBU[0000] Found SSH_AUTH_SOCK "/var/folders/ff/y12n_58x3yq88ysv7jk864p40000gn/T//ssh-itLGKjzLvN9B/agent.595", ssh-agent signer(s) enabled 
DEBU[0000] SSH Agent Key SHA256:ucuqyTCiUBQSM+huZ1uxzQHtO9OMdHFwrvuUlxwXxMM ssh-rsa 
DEBU[0000] DoRequest Method: GET URI: http://d/v4.1.1/libpod/_ping 
DEBU[0000] Loading registries configuration "/etc/containers/registries.conf" 
DEBU[0000] No credentials matching pierone.stups.zalan.do found in /Users/ponimas/.config/containers/auth.json 
DEBU[0000] No credentials matching pierone.stups.zalan.do found in /Users/ponimas/.config/containers/auth.json 
DEBU[0000] Looking up in credential helper pierone based on credHelpers entry in /Users/ponimas/.docker/config.json 
DEBU[0000] Found credentials for pierone.stups.zalan.do in credential helper containers-auth.json in file /Users/ponimas/.docker/config.json 
DEBU[0000] DoRequest Method: POST URI: http://d/v4.1.1/libpod/images/pull 
DEBU[0000] DoRequest Method: POST URI: http://d/v4.1.1/libpod/containers/create 
INFO[0000] Going to attach to container "ca8d4efa8af12f0fe13a9162dd5757d79cfb6196aced5e4da4eee8a36ce48185" 
DEBU[0000] DoRequest Method: GET URI: http://d/v4.1.1/libpod/containers/ca8d4efa8af12f0fe13a9162dd5757d79cfb6196aced5e4da4eee8a36ce48185/json 
DEBU[0000] DoRequest Method: POST URI: http://d/v4.1.1/libpod/containers/ca8d4efa8af12f0fe13a9162dd5757d79cfb6196aced5e4da4eee8a36ce48185/attach 
DEBU[0000] Copying standard streams of container "ca8d4efa8af12f0fe13a9162dd5757d79cfb6196aced5e4da4eee8a36ce48185" in non-terminal mode 
DEBU[0000] Copying STDIN to socket                      
INFO[0000] Going to start container "ca8d4efa8af12f0fe13a9162dd5757d79cfb6196aced5e4da4eee8a36ce48185" 
DEBU[0000] DoRequest Method: POST URI: http://d/v4.1.1/libpod/containers/ca8d4efa8af12f0fe13a9162dd5757d79cfb6196aced5e4da4eee8a36ce48185/start 
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2022/06/22 15:14:23 [notice] 1#1: using the "epoll" event method
2022/06/22 15:14:23 [notice] 1#1: nginx/1.21.6
2022/06/22 15:14:23 [notice] 1#1: built by gcc 10.2.1 20210110 (Debian 10.2.1-6) 
2022/06/22 15:14:23 [notice] 1#1: OS: Linux 5.18.5-200.fc36.aarch64
2022/06/22 15:14:23 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 524288:524288
2022/06/22 15:14:23 [notice] 1#1: start worker processes
2022/06/22 15:14:23 [notice] 1#1: start worker process 26
2022/06/22 15:14:23 [notice] 1#1: start worker process 27
^C
➜  ~ 

Output of podman version:

lient:       Podman Engine
Version:      4.1.1
API Version:  4.1.1
Go Version:   go1.18.3
Built:        Tue Jun 14 22:12:46 2022
OS/Arch:      darwin/arm64

Server:       Podman Engine
Version:      4.1.0
API Version:  4.1.0
Go Version:   go1.18.2
Built:        Mon May 30 18:04:32 2022
OS/Arch:      linux/arm64

Output of podman info --debug:

host:
  arch: arm64
  buildahVersion: 1.26.1
  cgroupControllers:
  - cpu
  - io
  - memory
  - pids
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.1.0-2.fc36.aarch64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.0, commit: '
  cpuUtilization:
    idlePercent: 99.7
    systemPercent: 0.2
    userPercent: 0.1
  cpus: 2
  distribution:
    distribution: fedora
    variant: coreos
    version: "36"
  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: 5.18.5-200.fc36.aarch64
  linkmode: dynamic
  logDriver: journald
  memFree: 3513565184
  memTotal: 4090519552
  networkBackend: netavark
  ociRuntime:
    name: crun
    package: crun-1.4.5-1.fc36.aarch64
    path: /usr/bin/crun
    version: |-
      crun version 1.4.5
      commit: c381048530aa750495cf502ddb7181f2ded5b400
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +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-0.2.beta.0.fc36.aarch64
    version: |-
      slirp4netns version 1.2.0-beta.0
      commit: 477db14a24ff1a3de3a705e51ca2c4c1fe3dda64
      libslirp: 4.6.1
      SLIRP_CONFIG_VERSION_MAX: 3
      libseccomp: 2.5.3
  swapFree: 0
  swapTotal: 0
  uptime: 4h 22m 12.55s (Approximately 0.17 days)
plugins:
  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: 106825756672
  graphRootUsed: 3219861504
  graphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Using metacopy: "false"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 4
  runRoot: /run/user/501/containers
  volumePath: /var/home/core/.local/share/containers/storage/volumes
version:
  APIVersion: 4.1.0
  Built: 1653926672
  BuiltTime: Mon May 30 18:04:32 2022
  GitCommit: ""
  GoVersion: go1.18.2
  Os: linux
  OsArch: linux/arm64
  Version: 4.1.0

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

brew info podman
podman: stable 4.1.1 (bottled), HEAD
Tool for managing OCI containers and pods
https://podman.io/
/opt/homebrew/Cellar/podman/4.1.1 (174 files, 46.4MB) *
  Poured from bottle on 2022-06-16 at 06:53:11
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/podman.rb
License: Apache-2.0
==> Dependencies
Build: go ✘, go-md2man ✘
Required: qemu ✘
==> Options
--HEAD
	Install HEAD version
==> Caveats
zsh completions have been installed to:
  /opt/homebrew/share/zsh/site-functions
==> Analytics
install: 19,991 (30 days), 60,518 (90 days), 161,801 (365 days)
install-on-request: 19,812 (30 days), 60,294 (90 days), 161,556 (365 days)
build-error: 4 (30 days)

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)

Yes/No

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

OSX Monterey 12.4
MacBook Pro (14-inch, 2021)
Chip:	Apple M1 Max
@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Jun 23, 2022
@github-actions github-actions bot added macos MacOS (OSX) related remote Problem is in podman-remote labels Jun 23, 2022
@mheon
Copy link
Member

mheon commented Jun 23, 2022

Can you try adding --sig-proxy=true to your command? It should be true by default, but I don't see the debug logs indicating it's active.

@ponimas
Copy link
Author

ponimas commented Jun 23, 2022

podman run -t --log-level=debug --sig-proxy=true nginx
INFO[0000] podman filtering at log level debug          
DEBU[0000] Called run.PersistentPreRunE(podman run -t --log-level=debug --sig-proxy=true nginx) 
DEBU[0000] SSH Ident Key "/Users/ponimas/.ssh/podman-machine-default" SHA256:tOvATDNZzT3jTcmqxc4SrKQnIicNP17+MTCNpfV3FIk ssh-ed25519 
DEBU[0000] Found SSH_AUTH_SOCK "/var/folders/ff/y12n_58x3yq88ysv7jk864p40000gn/T//ssh-itLGKjzLvN9B/agent.595", ssh-agent signer(s) enabled 
DEBU[0000] SSH Agent Key SHA256:ucuqyTCiUBQSM+huZ1uxzQHtO9OMdHFwrvuUlxwXxMM ssh-rsa 
DEBU[0000] DoRequest Method: GET URI: http://d/v4.1.1/libpod/_ping 
DEBU[0000] Loading registries configuration "/etc/containers/registries.conf" 
DEBU[0000] No credentials matching pierone.stups.zalan.do found in /Users/ponimas/.config/containers/auth.json 
DEBU[0000] No credentials matching pierone.stups.zalan.do found in /Users/ponimas/.config/containers/auth.json 
DEBU[0000] Looking up in credential helper pierone based on credHelpers entry in /Users/ponimas/.docker/config.json 
DEBU[0000] Found credentials for pierone.stups.zalan.do in credential helper containers-auth.json in file /Users/ponimas/.docker/config.json 
DEBU[0000] DoRequest Method: POST URI: http://d/v4.1.1/libpod/images/pull 
DEBU[0000] DoRequest Method: POST URI: http://d/v4.1.1/libpod/containers/create 
INFO[0000] Going to attach to container "b67fd7a209730c670729e93a57299b571ce5a6e6c76128ca333111a173684134" 
DEBU[0000] DoRequest Method: GET URI: http://d/v4.1.1/libpod/containers/b67fd7a209730c670729e93a57299b571ce5a6e6c76128ca333111a173684134/json 
DEBU[0000] DoRequest Method: POST URI: http://d/v4.1.1/libpod/containers/b67fd7a209730c670729e93a57299b571ce5a6e6c76128ca333111a173684134/attach 
INFO[0000] Going to start container "b67fd7a209730c670729e93a57299b571ce5a6e6c76128ca333111a173684134" 
DEBU[0000] DoRequest Method: POST URI: http://d/v4.1.1/libpod/containers/b67fd7a209730c670729e93a57299b571ce5a6e6c76128ca333111a173684134/start 
DEBU[0000] Copying STDOUT of container in terminal mode 
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2022/06/22 15:51:07 [notice] 1#1: using the "epoll" event method
2022/06/22 15:51:07 [notice] 1#1: nginx/1.21.6
2022/06/22 15:51:07 [notice] 1#1: built by gcc 10.2.1 20210110 (Debian 10.2.1-6) 
2022/06/22 15:51:07 [notice] 1#1: OS: Linux 5.18.5-200.fc36.aarch64
2022/06/22 15:51:07 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 524288:524288
2022/06/22 15:51:07 [notice] 1#1: start worker processes
2022/06/22 15:51:07 [notice] 1#1: start worker process 26
2022/06/22 15:51:07 [notice] 1#1: start worker process 27
^C
podman ps
CONTAINER ID  IMAGE                           COMMAND               CREATED       STATUS           PORTS       NAMES
b67fd7a20973  docker.io/library/nginx:latest  nginx -g daemon o...  27 hours ago  Up 27 hours ago              brave_elion

@ponimas
Copy link
Author

ponimas commented Jun 23, 2022

oh... that was with -t
here is with -i

➜  ~ podman run -i --log-level=debug --sig-proxy=true nginx
INFO[0000] podman filtering at log level debug          
DEBU[0000] Called run.PersistentPreRunE(podman run -i --log-level=debug --sig-proxy=true nginx) 
DEBU[0000] SSH Ident Key "/Users/ponimas/.ssh/podman-machine-default" SHA256:tOvATDNZzT3jTcmqxc4SrKQnIicNP17+MTCNpfV3FIk ssh-ed25519 
DEBU[0000] Found SSH_AUTH_SOCK "/var/folders/ff/y12n_58x3yq88ysv7jk864p40000gn/T//ssh-itLGKjzLvN9B/agent.595", ssh-agent signer(s) enabled 
DEBU[0000] SSH Agent Key SHA256:ucuqyTCiUBQSM+huZ1uxzQHtO9OMdHFwrvuUlxwXxMM ssh-rsa 
DEBU[0000] DoRequest Method: GET URI: http://d/v4.1.1/libpod/_ping 
DEBU[0000] Loading registries configuration "/etc/containers/registries.conf" 
DEBU[0000] No credentials matching pierone.stups.zalan.do found in /Users/ponimas/.config/containers/auth.json 
DEBU[0000] No credentials matching pierone.stups.zalan.do found in /Users/ponimas/.config/containers/auth.json 
DEBU[0000] Looking up in credential helper pierone based on credHelpers entry in /Users/ponimas/.docker/config.json 
DEBU[0000] Found credentials for pierone.stups.zalan.do in credential helper containers-auth.json in file /Users/ponimas/.docker/config.json 
DEBU[0000] DoRequest Method: POST URI: http://d/v4.1.1/libpod/images/pull 
DEBU[0000] DoRequest Method: POST URI: http://d/v4.1.1/libpod/containers/create 
INFO[0000] Going to attach to container "60e82b1b368eeb14b48c86baea7e6517e2d582aac0a824f7b304e4222287b8b8" 
DEBU[0000] DoRequest Method: GET URI: http://d/v4.1.1/libpod/containers/60e82b1b368eeb14b48c86baea7e6517e2d582aac0a824f7b304e4222287b8b8/json 
DEBU[0000] DoRequest Method: POST URI: http://d/v4.1.1/libpod/containers/60e82b1b368eeb14b48c86baea7e6517e2d582aac0a824f7b304e4222287b8b8/attach 
INFO[0000] Going to start container "60e82b1b368eeb14b48c86baea7e6517e2d582aac0a824f7b304e4222287b8b8" 
DEBU[0000] DoRequest Method: POST URI: http://d/v4.1.1/libpod/containers/60e82b1b368eeb14b48c86baea7e6517e2d582aac0a824f7b304e4222287b8b8/start 
DEBU[0000] Copying standard streams of container "60e82b1b368eeb14b48c86baea7e6517e2d582aac0a824f7b304e4222287b8b8" in non-terminal mode 
DEBU[0000] Copying STDIN to socket                      
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2022/06/22 15:54:18 [notice] 1#1: using the "epoll" event method
2022/06/22 15:54:18 [notice] 1#1: nginx/1.21.6
2022/06/22 15:54:18 [notice] 1#1: built by gcc 10.2.1 20210110 (Debian 10.2.1-6) 
2022/06/22 15:54:18 [notice] 1#1: OS: Linux 5.18.5-200.fc36.aarch64
2022/06/22 15:54:18 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 524288:524288
2022/06/22 15:54:18 [notice] 1#1: start worker processes
2022/06/22 15:54:18 [notice] 1#1: start worker process 26
2022/06/22 15:54:18 [notice] 1#1: start worker process 27
^C
➜  ~ podman ps                                             
CONTAINER ID  IMAGE                           COMMAND               CREATED       STATUS           PORTS       NAMES
60e82b1b368e  docker.io/library/nginx:latest  nginx -g daemon o...  27 hours ago  Up 27 hours ago              vibrant_mirzakhani

@mheon
Copy link
Member

mheon commented Jun 24, 2022

Looking further, I don't see a sig-proxy implementation for remote Podman. Should not be difficult to add.

@mheon mheon added the Good First Issue This issue would be a good issue for a first time contributor to undertake. label Jun 24, 2022
@boaz0
Copy link
Collaborator

boaz0 commented Jun 26, 2022

@mheon can you assign this to me?
Thanks

@rhatdan
Copy link
Member

rhatdan commented Jun 26, 2022

Done

@github-actions
Copy link

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

@rhatdan
Copy link
Member

rhatdan commented Jul 28, 2022

@boaz0 any movement on this?

@boaz0
Copy link
Collaborator

boaz0 commented Jul 31, 2022

@rhatdan opened a PR #15131

@github-actions
Copy link

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

@rhatdan
Copy link
Member

rhatdan commented Sep 6, 2022

This is actively being worked on by @boaz0

@ponimas
Copy link
Author

ponimas commented Sep 22, 2022

When should we expect a release?

@mheon
Copy link
Member

mheon commented Sep 22, 2022 via email

@abcfy2
Copy link

abcfy2 commented Apr 10, 2023

Same issue here, ctr-c is not working in Archlinux

@rhatdan
Copy link
Member

rhatdan commented Apr 10, 2023

Please don't add to closed issue. Open a new issue, but first make sure the app within the container responds to ctr-c.

@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 Aug 27, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Good First Issue This issue would be a good issue for a first time contributor to undertake. 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.

5 participants