#1442 PR merged: Systemd automatic serial console detection

Labels: cleanup, fixed / solved / done, minor bug

schabrolles opened issue at 2017-08-11 07:13:

I encounter an issue last time when trying to migrate a VM from oVirt on POWER to PowerVM.
After booting the LPAR (PowerVM guest) on the ReaR recue image, I can't log into the console.
To solve that issue I had to connect via SSH and start agetty on hvc0 manually (or run again /etc/scripts/system-setup).

oVirt VM use VNC console (tty1) while PowerVM partition need to use hvc0 serial console.
Because backup was done on oVirt VM, hvc0 was not present, but this means that hvc0 was not automatically detected by ReaR => serial console detection is not working.

(This was working in the past.... may be a possible regression ... #1398)

Anyway, I dig a bit this and realized that this problem only exist on systemd based OS (RHEL7 or SLES12); and discover that /usr/lib/systemd/system-generators/systemd-getty-generator was responsible to detect console and serial console to activate them automatically.

I propose then to add this file to COPY_AS_IS variable when running on a systemd OS.
After doing that, my hvc0 console was automatically detected and activated with agetty when booting in recovery.

I also propose some cleanup by removing unnecessary KERNEL_CMDLINE option (this could may be satisfy #1420)

tested successfully with:

  • SLE12-SP2
  • RHEL7.3
  • SLES11-SP4 (to test possible regression with a non-systemd OS)

The next question is:

  • There some other systemd-generator scripts in /usr/lib/systemd/system-generators/, we may be need to check if there is some other script we should add.
cloud-init-generator
ibft-rule-generator
lvm2-activation-generator
nfs-server-generator
systemd-cryptsetup-generator
systemd-dbus1-generator
systemd-debug-generator
systemd-fstab-generator
systemd-getty-generator
systemd-gpt-auto-generator
systemd-hibernate-resume-generator
systemd-insserv-generator
systemd-rc-local-generator
systemd-system-update-generator
systemd-sysv-generator

schlomo commented at 2017-08-11 07:38:

👍 amazingly simple fix!

You can merge this yourself.

jsmeix commented at 2017-08-23 10:34:

@schabrolles
regarding possible regressions because of redirected STDOUT:

Currently STDOUT is not redirected, see
https://github.com/rear/rear/issues/1398#issuecomment-315325470
in particular it is not redirected in the ReaR 2.2 release.

But I intend to re-enable redirected STDOUT soon
while ReaR 2.3 is under development and fix as much
as I can there.

Whether or not STDOUT will be redirected in the ReaR 2.3 release
depends on our experience how redirected STDOUT behaves
while ReaR 2.3 is under development.


[Export of Github issue for rear/rear.]