]> git.proxmox.com Git - pve-container.git/commitdiff
setup: move setup_container_getty_service to Base
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 18 Feb 2016 09:54:51 +0000 (10:54 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 18 Feb 2016 10:46:08 +0000 (11:46 +0100)
And reuse it for ArchLinux.

src/PVE/LXC/Setup/ArchLinux.pm
src/PVE/LXC/Setup/Base.pm
src/PVE/LXC/Setup/SUSE.pm

index 352d21a7b25a3a44fc48189a52c02d7602066fbe..1e60fa6a59a00477c98979973b974a0e3f4ffbd8 100644 (file)
@@ -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 {
index 8991b29849c9db5af0447a98113dc218ab3b4b64..d84c80e90543bdfefc23d7a4252dde5fc12fba35 100644 (file)
@@ -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) = @_;
 
index 165f2da2abf9bef2c1060ad169ce8a05825e660a..b7814fa10a6def40c2a06acb9959ea9012f96ec4 100644 (file)
@@ -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) = @_;