[pve-devel] [PATCH container 2/2] setup getty: ensure the getty.target is enabled

Thomas Lamprecht t.lamprecht at proxmox.com
Thu Jul 18 11:13:46 CEST 2019


On 7/18/19 10:23 AM, Fabian Grünbichler wrote:
> On Wed, Jul 17, 2019 at 12:08:25PM +0200, Thomas Lamprecht wrote:
>> +
>> +    my $targetfile = "$systemd_dir_rel/getty.target";
>> +    my $getty_target_lnk = "/etc/systemd/system/getty.target";
>> +
>> +    $self->ct_unlink($getty_target_lnk);
>> +    $self->ct_symlink($targetfile, $getty_target_lnk);
>> +}
> 
> this does not enable the target, it just unmasks it in a
> non-straightforward fashion..
> 
> in practice it likely effectively enables it as well, since getty.target
> is a static unit that is by default statically enabled/pulled in by
> multi-user.target, so unless that standard target has been modified
> unmasking == enabling.
> 
> simply removing any symlink in /etc/systemd/system/getty.target pointing
> to /dev/null should have the same effect, without overruling any

how do you mean any? getty.target is never a directory?

> replacements admins/templates might have put into place in /etc,

as we explicitly control the TTYs from VM admin set rules I see
no point in doing a "/dev/null" check, if an CT admin really wants
us to not touch this they can simply add a ".pve-ignore.$filename"
file to tell us so, then all ct_{unlink,link,..} will ignore it just
fine...

for v2 I'd do a unlink + link to /etc multi-user.target.wants.d, as
we normally really want this to work (and as said an admin has the
possibility to undo this)





More information about the pve-devel mailing list