containers / podman-compose

a script to run docker-compose.yml using podman
GNU General Public License v2.0
5.01k stars 477 forks source link

Ctrl+C in `up` command does not work properly #112

Open TomaszGasior opened 4 years ago

TomaszGasior commented 4 years ago

related https://github.com/containers/podman-compose/issues/51

When docker-compose up is running foreground I can press Ctrl+C to gracefully stop all of my containers. It's not possible with podman-compose from devel branch: when pressed Ctrl+C instead of stopping all containers only one is stopped, other are kept alone. Also, error is shown.

This is my project: https://github.com/TomaszGasior/RadioLista-v3/ (basically, web application) yaml file is here: https://github.com/TomaszGasior/RadioLista-v3/blob/f95d816dd05e4d40d1ebd1fcad7f75174e952eab/docker-compose.yaml

Zrzut ekranu z 2020-02-13 11-46-23

seocam commented 4 years ago

This is also happening here.

I'm using: podman-1.8.0-2.fc31.x86_64 podman-compose==0.1.6.dev0

Enrico204 commented 4 years ago

I've added a pull request to fix this :-) #139

universam1 commented 2 years ago

Thank you @Enrico204 for the PR but it did never land? Still facing the same issue that I'm unable to stop all pods, any workaround possible?

Enrico204 commented 2 years ago

@universam1 I don't think so. The original PR was not merged (maybe because some issues) and I lost interest in podman-compose. Feel free to cherry-pick those fixes and apply them to the current codebase :-)

sionik commented 1 year ago

Any news on this?

I get the same error:

[pihole] |   Pi-hole version is v5.17.1 (Latest: v5.17.1)
[pihole] |   AdminLTE version is v5.20.1 (Latest: v5.20.1)
[pihole] |   FTL version is v5.23 (Latest: v5.23)
[pihole] |   Container tag is: 2023.05.2
[pihole] | 
^CTraceback (most recent call last):
  File "/usr/bin/podman-compose", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3.11/site-packages/podman_compose.py", line 2941, in main
    podman_compose.run()
  File "/usr/lib/python3.11/site-packages/podman_compose.py", line 1423, in run
    cmd(self, args)
  File "/usr/lib/python3.11/site-packages/podman_compose.py", line 1754, in wrapped
    return func(*args, **kw)
           ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/podman_compose.py", line 2117, in compose_up
    thread.join(timeout=1.0)
  File "/usr/lib/python3.11/threading.py", line 1116, in join
    self._wait_for_tstate_lock(timeout=max(timeout, 0))
  File "/usr/lib/python3.11/threading.py", line 1132, in _wait_for_tstate_lock
    if lock.acquire(block, timeout):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyboardInterrupt
s6-rc: info: service legacy-services: stopping

Versions in use:

podman-compose version: 1.0.6
['podman', '--version', '']
using podman version: 4.6.2
podman-compose version 1.0.6
podman --version 
podman version 4.6.2
exit code: 0

yaml file:

version: "3"

services:
  pihole:
    image: pihole/pihole:latest
    restart: unless-stopped
    ports:
      - "53:53/tcp"
      - "53:53/udp"
      - "80:80/tcp"
    environment:
      TZ: 'Europe/Berlin'
    volumes:
      - './data/etc/pihole:/etc/pihole'
      - './data/etc/dnsmasq.d:/etc/dnsmasq.d'
llowinge commented 7 months ago

Maybe it could be already fixed in next version with https://github.com/containers/podman-compose/blob/devel/podman_compose.py#L2311 ? WDYT @muayyad-alsadi ?