docker-compose destroys current TTY session #1380
Comments
Hmm... Maybe that's what |
Removing the command causes the container to shut down running up, but at least it doesn't kill my :X session. Tried `command: /bin/bash, but that didn't really do anything. |
It looks like it's something to do with the combination of the following:
|
@mradcliffe - It looks like you're running I haven't yet tested this on anything other than my Mac or on Travis CI. |
Thanks, @geerlingguy. I wanted to provide some feedback. I finally got to looking at things since you're work at DrupalCon. What does "drops me back into my normal shell" mean in Terminal.app on MacOS? Does that mean some sort of significant visual change to your terminal window, or merely the command in bash completing and ready for the next interaction? I think my next step to investigate would be to look at keeping the container unprivileged and figuring out why the container immediately stops after starting. Maybe a command I need to run instead of |
This. And the reason systemd is run is because inside the container, the way I have it set up (to make it work similar on Docker as it runs on a VM) is to use If you change it to something else, whatever that thing is would need to make sure that everything's running inside the Docker container. |
Okay, hmm... So apparently I have the container running when running unprivileged and it's running /lib/systemd/systemd, but not correctly. Probably because it's unprivileged. I was able to run |
I tried adding tmpfs and a bind mount for cgroup...
|
Did that work? I'm away from my home office, where I could do some testing on a Linux machine, so I'm only able to test against Mac right now. |
No, I did not have any success with that though supposedly that is supposed to work. I also tried adding
Although I'm unsure if any of that did anything because there does not seem to be any verbose logging from docker-compose :( |
I did not have any success today trying to get systemd to run in an unprivileged container despite trying to setup my system similar to what I learned in
Finally I found docker-systemctl-replacement, which looks promising. If I install that and then run I'm guessing this issue should be moved to https://github.com/geerlingguy/docker-debian8-ansible ? Edit: shouldn't @ people without permission. |
Yikes, and yes, we can take the discussion over there. Although my https://github.com/geerlingguy/docker-ubuntu1604-ansible image contains similar configuration to the Debian 8 one... Note that I could also modify the postfix role (and perhaps others too, which manage |
I'm sorry I have not followed up on this yet to either create an issue in one of the docker-**-ansible repositories. I got busy with other things and have not had a chance to hack around. |
@geerlingguy @mradcliffe we experienced this in a completely different environment but with a similar outcome: add |
Thank you for the advice @tanner-bruce. However I was not able to see any difference when I added the following in docker-compose.yml:
I tried quoted or unquoted and provision still failed. More recently I was pointed to docker4drupal, but I have not tried it yet. That approach seems to be the multiple app container approach instead of a singular container approach. |
I managed to get this to work in privileged mode without destroying user session:
RUN systemctl mask dev-mqueue.mount dev-hugepages.mount \
systemd-remount-fs.service sys-kernel-config.mount \
sys-kernel-debug.mount sys-fs-fuse-connections.mount \
systemd-logind.service getty.service getty.target
# systemd stops with SIGRTMIN+3, not SIGTERM
STOPSIGNAL SIGRTMIN+3
volumes:
- ./:/var/www/drupalvm/:rw,delegated
- /var/lib/mysql
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- /var/log/journal
tmpfs:
- /run Quite likely, masking either |
This happened to me on Arch and the normal shortcut to return to my X session didn't work -- had to power down and reboot |
Going to close this ticket as it has a few potential workarounds documented, and seems to only be an issue on certain Linux distros. Additionally, the way Drupal VM does Docker may either change a bit in the future, or might be deprecated at some point... |
…sions More info on the workaround: geerlingguy/drupal-vm#1380
…sions More info on the workaround: geerlingguy/drupal-vm#1380
Still hitting this exactly on Ubuntu 19.04 for some reason tested numerous ways. Works fine on my work mac though, which is very frustrating... No suggesting we reopen. I'll report back if I can find more concrete stuff as to WHY it does this. I spent a lot of time trying different methods, but ultimately if you need to tinker with something that has a service file, you're going to need systemd. |
Issue Type
-- Purpose: Drupal VM Docker testing/user feedback
Your Environment
bash-4.3$ . env/bin/activate (env) bash-4.3$ python --version Python 3.4.6 (env) bash-4.3$ docker --version Docker version 1.13.1, build 092cba3727bb9b4a2f0e922cd6c0f93ea270e363 (env) bash-4.3$ docker-compose --version docker-compose version 1.12.0, buil db31ff33
docker-compose.yml:
Your OS
Full console output
Summary
Running
docker-compose up -d
kills my current session (running x.org with a terminal running tmux with several windows and panes), and sends me to a TTY console for Drupal VM. Not sure what username or password to use from there. Should I expect to lose my current X session when running docker-compose? I upgraded from an older version of docker, and my familiarity with it was that runningdocker start <container>
wouldn't do anything drastic, but I'm not sure what I should be expecting with Drupal VM run outside of a VM or what I should do after that.I also tried SSH from a laptop, running the command, and that still kicked my main linux session back to TTY with Debian login prompt.
I think that the eventual expectation is that I should be able to run my IDE and then run docker-compose up on the same box?
The text was updated successfully, but these errors were encountered: