Skip to content
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

Systemd automatic serial console detection #1442

Merged
merged 3 commits into from Aug 11, 2017

Conversation

schabrolles
Copy link
Member

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
Copy link
Member

schlomo commented Aug 11, 2017

👍 amazingly simple fix!

You can merge this yourself.

@schabrolles schabrolles merged commit bc974b4 into rear:master Aug 11, 2017
@schabrolles schabrolles deleted the systemd_serial_console_detection branch August 11, 2017 08:33
@schabrolles schabrolles restored the systemd_serial_console_detection branch August 11, 2017 11:55
@schabrolles schabrolles deleted the systemd_serial_console_detection branch August 11, 2017 17:19
schabrolles added a commit to schabrolles/rear that referenced this pull request Aug 17, 2017
 - as hvc0 tty are now automatically created by systemd (rear#1442) we don't
need to create them manually.
@jsmeix
Copy link
Member

jsmeix commented Aug 23, 2017

@schabrolles
regarding possible regressions because of redirected STDOUT:

Currently STDOUT is not redirected, see
#1398 (comment)
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup fixed / solved / done minor bug An alternative or workaround exists
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants