Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Interactive Terminal / TTY Hangup #19
When using tini with a TTY, interactive shell commands like
FROM krallin/ubuntu-tini:trusty RUN apt-get update && apt-get install -y --no-install-recommends python
FROM debian:8.2 RUN apt-get update && \ apt-get install -y --no-install-recommends ca-certificates curl libc6 python && \ curl -sSL "https://github.com/krallin/tini/releases/download/v0.8.0/tini" -o /usr/bin/tini && \ chmod +x /usr/bin/tini && \ rm -rf /var/lib/apt/lists/* ENTRYPOINT ["/usr/bin/tini", "--"]
$ docker build -t tini-tty . $ docker run --rm -it tini-tty python
Commenting out the
Am I missing something simple here like an option? Thanks!
Indeed, this isn't super surprising. Interactive mode isn't something I have considered as a goal so far (and thus not something I worked on).
Now, that doesn't mean it shouldn't be supported! If it's lightweight and doesn't make the tool harder to use, then it should be supported (one of the design goals of Tini is that adding it shouldn't break things that would otherwise work).
I'll try to get to the bottom of this and fix it (happy to hear suggestions!).
Thanks! This isn't a mission-critical requirement... I just wondered if I was missing something obvious. FWIW, here's the output of running w/
$ docker run --rm -it tini python [INFO ] Spawned child process 'python' with pid '8' Python 2.7.6 (default, Jun 22 2015, 17:58:13) [GCC 4.8.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. [DEBUG] Passing signal: 'Window changed' [TRACE] No child to reap [DEBUG] Received SIGCHLD [TRACE] No child to reap [...]
@mattwilliamsnyc just as a sidenote: you should check the hash of tini when curling it from github. See https://github.com/jenkinsci/docker/blob/master/Dockerfile for an example.
Ah, ok. I didn't know if this was published somewhere as an .asc or whatever. I have an update script that scrapes for the latest version and updates my base Dockerfiles:
curl -s https://github.com/krallin/tini/releases/latest | grep -o "/v.*\"" | sed 's:^..\(.*\).$:\1:'
I can do the hashing there and pin that as well. Thanks for the tip!
added a commit
Oct 28, 2015
referenced this issue
Oct 28, 2015
I was able to reproduce the issue, and I think I have a fix for it in #21
We introduced this as a side effect of #15 (tests didn't catch it, but now we have some that will).
The problem is that the foreground process group on the tty is Tini, not the child process group, which thus means the child process (Python in your example) hangs when it tries to write to tty / set settings.
In Python's case, this happens when the readline module is loaded (you can see that by running
The solution in #21 is to have Tini make the child process group the new foreground process group (and to gracefully bail if there is no tty).
I want to test a few last things before I merge it (namely identify whether there's a scenario where Tini itself ends up getting interrupted by