Give support for enable services. Systemd-resolved is masked now

This commit is contained in:
null31 2024-03-24 17:26:25 +01:00
parent 60f98845d2
commit abbbf8687c
Signed by: null31
GPG Key ID: CAB4CF4EE49720FF
1 changed files with 12 additions and 1 deletions

View File

@ -489,6 +489,12 @@ sub mask_systemd_unit {
symln '/dev/null', "$root/etc/systemd/system/$unit"; symln '/dev/null', "$root/etc/systemd/system/$unit";
} }
sub enable_systemd_unit {
my ($self, $unit) = @_;
my $root = $self->{rootfs};
symln "/usr/lib/systemd/system/$unit", "$root/etc/systemd/system/multi-user.target.wants/$unit";
}
sub bootstrap { sub bootstrap {
my ($self, $include, $exclude) = @_; my ($self, $include, $exclude) = @_;
my $root = $self->{rootfs}; my $root = $self->{rootfs};
@ -578,9 +584,14 @@ sub bootstrap {
$self->ve_command(['pacman', '-S', '--needed', '--noconfirm', '--', @$packages]); $self->ve_command(['pacman', '-S', '--needed', '--noconfirm', '--', @$packages]);
print "Masking problematic systemd units...\n"; print "Masking problematic systemd units...\n";
for my $unit (qw(sys-kernel-config.mount sys-kernel-debug.mount systemd-journald-audit.socket)) { for my $unit (qw(sys-kernel-config.mount sys-kernel-debug.mount systemd-journald-audit.socket systemd-resolved.service)) {
$self->mask_systemd_unit($unit); $self->mask_systemd_unit($unit);
} }
print "Enable systemd services...\n";
for my $unit (qw(sshd.service)) {
$self->enable_systemd_unit($unit);
}
} }
# devices needed for gnupg to function: # devices needed for gnupg to function: