From c078c5ee26a7d2ce730bd8f7560a5e5e33ddeaad Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 15 Aug 2018 18:23:13 -0400 Subject: librechroot,libremakepkg: Don't have stdin of nspawn be a TTY if we don't expect input If stdin is a TTY, systemd-nspawn will create a proxy PTY, and pump the data from real stdin through the proxy PTY. Because the PTY acts as a buffer, that means that it eats stdin, EVEN IF THE PROGRAM DOESN'T ACTUALLY READ IT. This is surprising to the user. We can't know if the command to `librechroot run` is going to read from stdin, but for most uses of librechroot we do know. So, set stdin to /dev/null for those cases. --- src/chroot-tools/librechroot | 10 +++++----- src/chroot-tools/libremakepkg | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/chroot-tools/librechroot b/src/chroot-tools/librechroot index 8167793..8092f8d 100755 --- a/src/chroot-tools/librechroot +++ b/src/chroot-tools/librechroot @@ -426,7 +426,7 @@ main() { if [[ ! -d $rootdir ]]; then msg "Creating 'root' copy for chroot [%s]" "$CHROOT" - mkarchroot "$rootdir" base-devel + mkarchroot "$rootdir" base-devel "$copydir/chrootexec" chmod 755 "$copydir/chrootexec" - arch-nspawn "$copydir" /chrootexec + arch-nspawn "$copydir" /chrootexec