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

Problem with ctrl+C signal (does not stop the command) #7783

Open
Wirone opened this issue Jan 26, 2024 · 3 comments
Open

Problem with ctrl+C signal (does not stop the command) #7783

Wirone opened this issue Jan 26, 2024 · 3 comments

Comments

@Wirone
Copy link
Member

Wirone commented Jan 26, 2024

We currently have problem with ctrl+C signal (does not stop the command when run in Docker). The fix / check commands must stop gracefully when SIGTERM is invoked.

$ docker run --rm -it -v $(pwd):/code ghcr.io/php-cs-fixer/php-cs-fixer:3-php8.3 check

and then ctrl+C should stop the command.

Originally posted by @Wirone in #7782 (comment)

@Wirone
Copy link
Member Author

Wirone commented Jan 26, 2024

It looks like it moving pcntl to the lower layer and including it in the Docker image does not solve the problem anyway, but running Docker container with --init makes ctrl+C work properly 🤔.

The change in #7782 is correct anyway, because symfony/console requires pcntl to work with signals.

@Wirone
Copy link
Member Author

Wirone commented Jan 26, 2024

@hgiesenow do you know what can be the root cause of Fixer not reacting to ctrl+C when running with docker run? When I run Fixer inside container and use ctrl+C inside the container, the Fixer's process stops properly.

$ docker run --rm -it --init -v $(pwd):/code --entrypoint="" fixer:local sh
/code # php-cs-fixer check
PHP CS Fixer 3.48.1-DEV Small Changes by Fabien Potencier, Dariusz Ruminski and contributors.
PHP runtime: 8.3.2
Loaded config default from "/code/.php-cs-fixer.php".
    0/1070 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░]   0%^C
/code #

fixer:local image used above is a local build (docker build --target dist -t fixer:local .) on branch with correct pcntl.

This comment was marked as outdated.

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

No branches or pull requests

1 participant