From: Wolfgang Bumiller Date: Thu, 18 Feb 2016 09:54:51 +0000 (+0100) Subject: setup: move setup_container_getty_service to Base X-Git-Url: https://git.proxmox.com/?p=pve-container.git;a=commitdiff_plain;h=90b21cdcb4100c4daf218b5efd857aae4a0a9f89 setup: move setup_container_getty_service to Base And reuse it for ArchLinux. --- diff --git a/src/PVE/LXC/Setup/ArchLinux.pm b/src/PVE/LXC/Setup/ArchLinux.pm index 352d21a..1e60fa6 100644 --- a/src/PVE/LXC/Setup/ArchLinux.pm +++ b/src/PVE/LXC/Setup/ArchLinux.pm @@ -39,11 +39,12 @@ sub template_fixup { '/etc/systemd/system/socket.target.wants/systemd-networkd.socket'); # edit /etc/securetty (enable login on console) - $self->setup_securetty($conf, qw(pts/0)); + $self->setup_securetty($conf, qw(lxc/console lxc/tty1 lxc/tty2 lxc/tty3 lxc/tty4)); } sub setup_init { - # Nothing to do + my ($self, $conf) = @_; + $self->setup_container_getty_service(); } sub setup_network { diff --git a/src/PVE/LXC/Setup/Base.pm b/src/PVE/LXC/Setup/Base.pm index 8991b29..d84c80e 100644 --- a/src/PVE/LXC/Setup/Base.pm +++ b/src/PVE/LXC/Setup/Base.pm @@ -243,6 +243,15 @@ sub setup_systemd_console { } } +sub setup_container_getty_service { + my ($self) = @_; + my $servicefile = '/usr/lib/systemd/system/container-getty@.service'; + my $raw = $self->ct_file_get_contents($servicefile); + if ($raw =~ s@pts/%I@lxc/tty%I@g) { + $self->ct_file_set_contents($servicefile, $raw); + } +} + sub setup_systemd_networkd { my ($self, $conf) = @_; diff --git a/src/PVE/LXC/Setup/SUSE.pm b/src/PVE/LXC/Setup/SUSE.pm index 165f2da..b7814fa 100644 --- a/src/PVE/LXC/Setup/SUSE.pm +++ b/src/PVE/LXC/Setup/SUSE.pm @@ -49,15 +49,6 @@ sub setup_init { $self->setup_systemd_console($conf); } -sub setup_container_getty_service { - my ($self) = @_; - my $servicefile = '/usr/lib/systemd/system/container-getty@.service'; - my $raw = $self->ct_file_get_contents($servicefile); - if ($raw =~ s@pts/%I@lxc/tty%I@g) { - $self->ct_file_set_contents($servicefile, $raw); - } -} - sub setup_network { my ($self, $conf) = @_;