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

why it freeze? #37

Open
5er9e1 opened this issue Jan 12, 2024 · 1 comment
Open

why it freeze? #37

5er9e1 opened this issue Jan 12, 2024 · 1 comment

Comments

@5er9e1
Copy link

5er9e1 commented Jan 12, 2024

I'm using Ubuntu Studio with low latency kernel (deeply merged with Debian repository packages, because I'm using Debian's repositories in main)

$ uname -a
Linux hostname 6.2.0-1017-lowlatency #17~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Nov  2 18:30:14 UTC 2 x86_64 GNU/Linux

And trying to run Postgresql container (postgres:16-alpine). And it doesn't work. It stuck beforepostgres process will be ran.

When I attach to container:

docker exec -it container_name bash

And run ps aux command, it shows me:

PID   USER     TIME  COMMAND
    1 root      4:41 su-exec postgres /usr/local/bin/docker-entrypoint.sh postgres
   16 root      0:00 bash
   22 root      0:00 ps aux

docker-entrypoint.sh stuck

When I try to run simple command like:

su-exec postgres ls

It just freezes and nothing happening until I press Ctrl+C

I have an another PC with usual Ubuntu 22.04 OS and same container and su-exec is working fine. It looks like also an environment problem so, I don't know how to reproduce it. However, it looks like that is a su-exec's bug too, because it even doesn't work being wrapped inside container. Any ideas? Should I provide some extra logs (and how to do it if yes)?

@5er9e1
Copy link
Author

5er9e1 commented Jan 12, 2024

I found a problem cause. It is happening because of apparmor configuration.

After adding --security-opt apparmor=unconfined to docker compose file:

version: '3.1'

services:
  pg:
    container_name: pg
    image: postgres:16-alpine
    network_mode: bridge
    security_opt:
      - apparmor=unconfined
    environment:
      POSTGRES_PASSWORD: pass
      POSTGRES_DB: pgdb
      POSTGRES_USER: user
    volumes:
      - ./pg/data:/var/lib/postgresql/data
    ports:
      - 5432:5432

us-exec is working fine

Not sure is it should be considered as su-exec related issue or just an environment issue. If second, feel free to close the ticket

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant