console-setup hangs under chroot debootstrap with a console login on ttyX

Bug #413415 reported by William Pitcock
38
This bug affects 9 people
Affects Status Importance Assigned to Milestone
console-setup (Ubuntu)
Confirmed
Undecided
Unassigned
Nominated for Karmic by William Pitcock

Bug Description

Binary package hint: console-setup

When debootstraping a Ubuntu chroot using debootstrap the console-setup postconfigure invokes the console-setup init-script.

When the console-setup initscript is invoked while there is a console login on one of the system ttys, it hangs forever trying to write to that tty.

When there is no console login, the behaviour is as expected. I do not know if this bug exists in Debian, however, because console-setup is not part of the base system there.

This is a critical issue because it makes debootstrap behave incorrectly on servers with people logged in on the console...

Revision history for this message
Colin Watson (cjwatson) wrote :

I'm planning to remove console-setup from our base system, which might fix this.

Revision history for this message
tavasti (tavasti) wrote :

Apparently same problem arises also with installing system with network console (console over ssh)
At least for me 'Configuring console-setup...' doesn't end.

Revision history for this message
tavasti (tavasti) wrote :

Looks like this affects network install if there is shell activated in actual console.

Revision history for this message
Erica Windisch (ewindisch) wrote :

To note, I've been experiencing this since at least Feisty... this (or a related issue) would additionally trigger crashes under certain circumstances. The only solution I've had has been to remove console-setup from the base system, which prevents installing non-base packages, such as openssh, until one runs 'apt-get -f install'. This clearly breaks many scripts...

To improve my workaround, I'm intending to try a 2-stage install...

Revision history for this message
Loïc Minier (lool) wrote :

As a workaround, if you don't need these packages, you can pass --exclude console-setup,kbd,ubuntu-minimal to debootstrap.

Changed in console-setup (Ubuntu):
status: New → Confirmed
Revision history for this message
Abdulrahman Dimashki (idimsh) wrote :

I have used the next workaround in Lucid -> Lucid setup:

If you already have the following process in process list:
/bin/sh /bin/setupcon --force --save
kill it from the host

or, -on the target- before installing console-setup package, install 'kbd', then

On the target:
cd /bin/
mv fgconsole fgconsole.bak
cat > fgconsole.new << EOF
> #!/bin/bash
>
> echo "intentional error" >&2
> exit 1
> EOF
chmod +x fgconsole.new
ln -s fgconsole.new fgconsole

this will make any invocation of /bin/fgconsole to fail, which will cause the postinstall script of console-setup to invoke 'setupcon' with '--save-only' parameter instead of '--save --force'

now install 'console-setup'
apt-get install console-setup

This will continue the post script if you have killed 'setupcon' previously.

After the installation, restore /bin/fgconsole.

Revision history for this message
Steffen Hemer (s-hemer) wrote :

Just ran across this bug because of a console-setup upgrade on a chroot-ed Xenial (installed via debootstrap, exported via nfs for PXE boot, upgrades always installed via chroot-ing on server). Whole upgrade process hangs at "Preconfiguring packages ...".
Set "console-setup console-setup-linux keyboard-configuration" on hold for now.

Revision history for this message
Steffen Hemer (s-hemer) wrote :

I have to add: the newest update for Bionic (1.178ubuntu2.9) runs through smoothly, nearly not recognized it.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.