New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Propagate $TERM from PID 1 to bash prompt to make nspawn better #3697

Closed
safinaskar opened this Issue Jul 10, 2016 · 3 comments

Comments

2 participants
@safinaskar

safinaskar commented Jul 10, 2016

  • Bug report

systemd version the issue has been seen with

230

Used distribution

Debian stretch

Steps to reproduce. Let's assume we have some chroot environment in /str with systemd (debian stretch with systemd 230 in my case). Let's also assume we work is some x terminal emulator, in my case this is konsole (sic!) from KDE. Now we type systemd-nspawn -D /str /sbin/init. Then we login into this container and then start some curses-based app, for example, nano. Then we exit from it.

Actual behavior. We will see that nano "ate" some output of systemd boot process. I. e. nano ate some info that was present in terminal.

Expected behavior. nano should not do this.

When I just start nano from konsole directly it doesn't eat anything.

It seems the cause is $TERM. If I type export TERM=xterm before running nano, everything is okey. So, systemd should propagate $TERM from PID 1 to bash prompt.

Possibly related issue: #3115.

@poettering

This comment has been minimized.

Show comment
Hide comment
@poettering

poettering Jul 20, 2016

Member

I figure nspawn could pass TERM to PID 1, and the getty generator could read TERM from its PID 1 and set it for gettys started on the container's console.

Member

poettering commented Jul 20, 2016

I figure nspawn could pass TERM to PID 1, and the getty generator could read TERM from its PID 1 and set it for gettys started on the container's console.

@safinaskar

This comment has been minimized.

Show comment
Hide comment
@safinaskar

safinaskar Jul 20, 2016

It seems nspawn already passes TERM to PID 1

safinaskar commented Jul 20, 2016

It seems nspawn already passes TERM to PID 1

poettering added a commit to poettering/systemd that referenced this issue Jul 27, 2016

core: inherit TERM from PID 1 for all services started on /dev/console
This way, invoking nspawn from a shell in the best case inherits the TERM
setting all the way down into the login shell spawned in the container.

Fixes: systemd#3697
@poettering

This comment has been minimized.

Show comment
Hide comment
@poettering

poettering Jul 27, 2016

Member

Fix waiting in #3820.

Member

poettering commented Jul 27, 2016

Fix waiting in #3820.

@keszybz keszybz closed this in 6af760f Aug 4, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment