question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: cannot set terminal process group (-1): Inappropriate ioctl for device

See original GitHub issue

When I have dumb-init in ENTRYPOINT like this

...
ENTRYPOINT ["/usr/bin/dumb-init"]
...

and then try to run bash with tty and interactively, I get this error:

docker run --rm -t -i dumb_init_image bash
bash: cannot set terminal process group (-1): Inappropriate ioctl for device
...

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:6
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
javabeancommented, Oct 19, 2016

Unfortunately I still see this error message, using dumb-init 1.2.0 (Ubuntu 16.04, both directly in the host shell, and inside a docker run --rm -ti ubuntu:16.04 bash):

$ ./dumb-init_1.2.0_amd64 bash
bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell
$ exit
$ ./dumb-init_1.2.0_amd64 -c bash
$ exit

Note that tini does not exhibit this problem (i.e. works fine with and without its -g flag).

2reactions
chriskuehlcommented, Jan 8, 2016

@alhafoudh still looking into the root cause. I think it’s something we can fix.

For now a workaround is to run in non-setsid mode using -c, e.g.

ENTRYPOINT ["/usr/bin/dumb-init", "-c", "--"]

The only difference behavior-wise is that signals are only forwarded to your direct child. So if you have a process tree like

PID 1: dumb-init
+---- PID 2: python server
    +---- PID 3: worker process
    +---- PID 4: worker process
    +---- PID 5: worker process

when you send docker signal, the signal is only delivered to PID 2 and not everything in the process group (potentially including the workers).

This is usually acceptable behavior since the server is supposed to handle signaling its workers before it dies anyway. Unfortunately there are some exceptions, which is why the default is setsid mode.

I’ll keep looking into this and get back to you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

cannot set terminal process group (-1): Inappropriate ioctl for ...
bash_profile" means run - -c "source ~/.bash_profile" as the user lfs non-interactively. Now the shell sees the option - and says, I am...
Read more >
What does the sh:cannot set terminal process group
I seems that prompting a shell from this init script won't give access to a device like tty0 , but will only let...
Read more >
"bash: cannot set terminal process group (-1): Inappropriate ...
"bash: cannot set terminal process group (-1): Inappropriate ioctl for device" when open Visual Studio Code integrated terminal #315.
Read more >
519237 – -bash: cannot set terminal process group (-1)
Bug 519237 - -bash: cannot set terminal process group (-1): Inappropriate ioctl for device. Summary: -bash: cannot set terminal process ...
Read more >
bash: cannot set terminal process group (-1) - Ask Ubuntu
Just received this error >> bash: cannot set terminal process group (-1): Inappropriate ioctl for device. then the disk partition went into ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found