zsh-users
 help / color / mirror / code / Atom feed
From: Moritz Bunkus <moritz@bunkus.org>
To: zsh-users@zsh.org
Subject: zsh inside systemd-nspawn and Ctrl+C
Date: Tue, 3 Feb 2015 13:34:58 +0100	[thread overview]
Message-ID: <20150203123457.GH5783@bunkus.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 2729 bytes --]

Hey,

Summary: I'm running into the problem that Ctrl+C stops working when I
run zsh inside a container via systemd-nspawn.

Background: I've been using chroots into full distribution trees in
order to build packages for several Linux distributions without running
full-fledged virtual machines. It basically boiled down to bind-mounting
a couple of directories and running »chroot /bin/zsh« inside the correct
directory.

For several technical reasons I'm trying to switch to using
systemd-nspawn. systemd-nspawn is setting up a container for the whole
thing (meaning various namespaces and control groups) similar to
lxc-start from lxc or OpenVZ. I don't run a full init inside that
container but solely /bin/zsh.

Now my problem. With the older method (chrooting) I could use Ctrl+C
properly from inside the chrooted zsh. Meaning typing something and
hitting Ctrl+C would abort the current line and give me a new pristine
prompt.

Not so with systemd-nspawn'd zsh: here Ctrl+c does nothing at all.

However, if I run the very same systemd-nspawn with bash instead of zsh
then bash will recognize Ctrl+C and act upon it properly.

Some more information on what I've tried:

- »stty -a« from systemd-nspawn'd zsh correctly shows »intr = ^C«

- Running »cat« from systemd-nspawn'd zsh and hitting Ctrl+C prints the
  characters »^C« but cat is not aborted and keeps running.

- Changing the interrupt key to Ctrl+X from systemd-nspawn'd zsh with
  »stty intr \^X« makes Ctrl+X not do anything anymore – just like
  Ctrl+C before that »stty intr…«.

- The same happens if I run zsh with --no-rcs.

- The same happens running ssh'ed in from another machine and from
  inside konsole running in a local X server; both cases use different
  TERM environment variables (»putty-256color« for the ssh case and
  »xterm« for the konsole/X case).

The actual command line I'm using is something like the following:

systemd-nspawn --directory=/other-linux/64/debian/jessie \
  --machine=64-debian-jessie --tmpfs=/var/lock \
  --setenv=SHELL=/bin/zsh5 --setenv=HOME=/root --user=root \
  -- /bin/zsh5 --no-rcs

This is a stripped-down version that I've confirmed to not to work.

zsh on the parent: 5.0.7; zsh inside the container: 5.0.7 (but I've
confirmed this with several older zsh versions as well, e.g. Debian
wheezy's 4.3.17).

Any ideas how I might continue debugging this issue? At this point I
don't even have an idea who the culprit might be (zsh? systemd-nspawn?
Configuration files?), not to mention how to get it working.

I'd appreciate any insight and will gladly provide more information if
necessary.

Thanks.

Kind regards,
mosu

[-- Attachment #2: Type: application/pgp-signature, Size: 181 bytes --]

             reply	other threads:[~2015-02-03 12:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-03 12:34 Moritz Bunkus [this message]
2015-02-04 17:34 ` Bart Schaefer
2015-02-04 19:25   ` Moritz Bunkus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150203123457.GH5783@bunkus.org \
    --to=moritz@bunkus.org \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).