From 736f9d6f4a075a39da9d04c1849e592f3dc8a9db Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Fri, 16 Jun 2023 09:39:45 +0200 Subject: [PATCH] setup: enable systemd-networkd via preset for archlinux Note that this is now done in `setup_init` which is a pre-start hook rather than a one time template fixup, however, the presets are only applied on first boot or if the user requests them explicitly, and the usual mechanisms to prevent the file from being written can be used. Signed-off-by: Wolfgang Bumiller (cherry picked from commit 454ea3918e70c7c0f82712c5bf1a6c2115e033f1) Signed-off-by: Thomas Lamprecht --- src/PVE/LXC/Setup/ArchLinux.pm | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/PVE/LXC/Setup/ArchLinux.pm b/src/PVE/LXC/Setup/ArchLinux.pm index e379ea1..f792161 100644 --- a/src/PVE/LXC/Setup/ArchLinux.pm +++ b/src/PVE/LXC/Setup/ArchLinux.pm @@ -25,18 +25,6 @@ sub new { sub template_fixup { my ($self, $conf) = @_; - # ArchLinux doesn't come with any particular predefined and enabled - # networking, so it probably makes sense to do the equivalent of - # 'systemctl enable systemd-networkd', since that's what we're configuring - # in setup_network - - # systemctl enable systemd-networkd - $self->ct_mkdir('/etc/systemd/system/multi-user.target.wants'); - $self->ct_mkdir('/etc/systemd/system/socket.target.wants'); - $self->ct_symlink('/usr/lib/systemd/system/systemd-networkd.service', - '/etc/systemd/system/multi-user.target.wants/systemd-networkd.service'); - $self->ct_symlink('/usr/lib/systemd/system/systemd-networkd.socket', - '/etc/systemd/system/socket.target.wants/systemd-networkd.socket'); # edit /etc/securetty (enable login on console) $self->setup_securetty($conf); @@ -46,6 +34,15 @@ sub template_fixup { sub setup_init { my ($self, $conf) = @_; + + $self->setup_systemd_preset({ + # ArchLinux doesn't come with any particular predefined and enabled + # networking, so it probably makes sense to do the equivalent of + # 'systemctl enable systemd-networkd', since that's what we're configuring + # in setup_network + 'systemd-networkd.service' => 1 + }); + $self->setup_container_getty_service($conf); } -- 2.39.2