[PKG-Openstack-devel] Bug#784334: Bug#784334: Inaccessible emergency shell on serial console

Gaudenz Steinlin gaudenz at debian.org
Mon May 18 14:39:00 UTC 2015


Hi Thomas

Thomas Goirand <thomas at goirand.fr> writes:

> Hi Gaudenz,
>
> Thanks for this useful bug report.
>
> Do you know how to tweak systemd to use tty1 instead? Is it possible to 
> just add something on the command line?

I investigated this some more and thin I found the optimal solution
which keeps regular console output on the serial console but starts the
emergency shell on tty0.

To do this the ExecStart setting of the emergency.service systemd unit
needs to be overriden. Create a file
/etc/systemd/system/emergency.service.d/console.conf with the following
content:
[Service]
ExecStart=
ExecStart=-/bin/sh -c "/sbin/sulogin /dev/tty0; /bin/systemctl --fail --no-block default"

This first reset the ExecStart setting and then sets it to start the
emergency shell on tty0.

The same should be done for rescue.service. The first attached patch
implements this for both services.

During my investigation I also found several other things that are
suboptimal about the boot setup:

1. The kernel is booted with the quiet commandline parameter. While this
   is a nice setting for physical hardware (especially laptop/desktops)
   to not clutter the boot I think this is suboptimal for cloud images
   where you only access the boot logs in case of problems. There the
   quiet parameter might suppress usefull output.
2. There are two copies of extlinux.conf one in / and another one in
   /boot/extlinux. There should only be one to not confuse users.
3. extlinux is installed into / for no good reason. Why not remove all
   the copying of extlinux.conf to / and just install to /boot/extlinux.
   This also avoids additional files in /
4. The kernel and initrd.img are referenced in extlinux.conf by their
   full path in /boot. This leads to problems if the kernel is updated
   to an ABI incompatible new version because then the filename changes.
   This can be avoided by just referencing the symlinks in /.

The second attached patch fixes these issues.

BTW, why are you using extlinux instead of grub2 which is the standard
bootloader in Debian? I would prefer the images to be as similar to the
default install as possible. With grub also the kernel update issue
would completely go away because update-grub takes care of this.

And one more thing. Why is the string "7.0.0-3" hardcoded into the image
filename? I would suggest to either just use debian-${RELEASE}-amd64 or
read the version number from /etc/debian_version (after debootstrap of
course and read from ${MOUNT_DIR}/etc/debian_version, we don't want the
version of the build host in the filename).

Gaudenz

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Start-rescue-and-emergency-shells-on-tty1.patch
Type: text/x-diff
Size: 1434 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/openstack-devel/attachments/20150518/68753810/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Improved-extlinux-configuration.patch
Type: text/x-diff
Size: 1829 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/openstack-devel/attachments/20150518/68753810/attachment-0001.patch>


More information about the Openstack-devel mailing list