ct_is_symlink and ct_readlink_recursive are not defined in
PVE::LXC::Setup::Plugin and thus not available for call in
PVE::LXC::Setup, thus it broke unmanaged CTs which does not descends
from the Base module, put from the abstract Plugin directly to avoid
touching its CTs at all (well, it's unmanaged)
We'd either need to add those symlink helpers to the abstract plugin
or, like we do now, add a new more general get_ct_init_path which
unmanaged can truthfully implement.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
my ($self) = @_;
my $init = $self->protected_call(sub {
- my $init_path = "/sbin/init";
- if ($self->{plugin}->ct_is_symlink($init_path)) {
- $init_path = $self->{plugin}->ct_readlink_recursive($init_path);
- }
- return $init_path;
+ return $self->{plugin}->get_ct_init_path();
});
return $init;
return 1;
}
+sub get_ct_init_path {
+ my ($self) = @_;
+
+ my $init_path = "/sbin/init";
+ if ($self->ct_is_symlink($init_path)) {
+ $init_path = $self->ct_readlink_recursive($init_path);
+ }
+ return $init_path;
+}
+
sub ssh_host_key_types_to_generate {
my ($self) = @_;
croak "implement me in sub-class\n";
}
+sub get_ct_init_path {
+ my ($self) = @_;
+ croak "implement me in sub-class\n";
+}
+
sub ssh_host_key_types_to_generate {
my ($self) = @_;
croak "implement me in sub-class\n";
return 1; # faking it won't normally hurt ;-)
}
+sub get_ct_init_path {
+ my ($self) = @_;
+ return '/sbin/init'; # only passed to unified_cgroupv2_support for now
+}
+
sub ssh_host_key_types_to_generate {
my ($self) = @_;
return;