From b6876f1182f8a020c16ebcf7fe6c9cda8b9ea6e8 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Thu, 21 Apr 2016 07:07:15 +0200 Subject: [PATCH] Debian: correctly setup getty service on systemd based containers File /etc/inittab does not exist on systemd based containers. --- debian/changelog | 2 ++ src/PVE/LXC/Setup/Debian.pm | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 9eafd9d..8486c5f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,8 @@ pve-container (1.0-61) unstable; urgency=medium * fix #942: restore ACL and other rootfs options from backup + * Debian: correctly setup getty service on systemd based containers + -- Proxmox Support Team Wed, 20 Apr 2016 11:25:34 +0200 pve-container (1.0-60) unstable; urgency=medium diff --git a/src/PVE/LXC/Setup/Debian.pm b/src/PVE/LXC/Setup/Debian.pm index db5d317..4dae668 100644 --- a/src/PVE/LXC/Setup/Debian.pm +++ b/src/PVE/LXC/Setup/Debian.pm @@ -40,6 +40,11 @@ sub new { sub setup_init { my ($self, $conf) = @_; + my $systemd = $self->ct_readlink('/sbin/init'); + if (defined($systemd) && $systemd =~ m@/systemd$@) { + $self->setup_container_getty_service(1); + } + my $filename = "/etc/inittab"; return if !$self->ct_file_exists($filename); @@ -69,11 +74,6 @@ sub setup_init { } $self->ct_file_set_contents($filename, $inittab); - - my $systemd = $self->ct_readlink('/sbin/init'); - if (defined($systemd) && $systemd =~ m@/systemd$@) { - $self->setup_container_getty_service(1); - } } sub remove_gateway_scripts { -- 2.39.5