Closed smokris closed 1 month ago
This could be one of those cases where we lie and just work, but given the description in glibc, I wonder if we need to keep some brand state about this or something.
Apologies for not looking more deeply. We actually have some of this already in the base OS (aka OS-2868 upstreamed to -gate as illumos#3252), with some caveats. Here's text from the illumos bug:
As part of this Keith Wesolowski originally did a survey of the various differences
between POSIX locks set through fcntl, lockf, flock, and the newer GNU OFD
(open file descriptor) locks which are trying to tackle and more broadly standardize
the notion of locks being set upon an open file descriptor. Based on this, he
determined that a flock is basically a specialized type of OFD, hence implementation
of similar APIs here.
So maybe we're Good Enough in the illumos#3252 support?
Additionally @smokris ==> Please inspect $UTS/common/syscall/fcntl.c to make sure the differences in LX's fcntl() vs. native's aren't further apart than Linux apps expect them to be.
Per an offline conversation with @smokris , I'm going to take over guiding this PR in. Depending on how cooperative github is, I may need to close this and open a new one. We'll see.
Closing PR in lieu of #471
Problem
On Debian 12 with backports enabled (or Debian Trixie or Debian Sid) running in SmartOS LX,
systemd-sysusers
fails after updating systemd to v254+, leading to failures inapt upgrade
.Steps to reproduce
imgadm import c5ba4e59-89b1-4804-b89e-b427923490b9
(latestdebian-12
lx-dataset
)echo '{"brand":"lx","image_uuid":"c5ba4e59-89b1-4804-b89e-b427923490b9","kernel_version":"4.15","resolvers":["1.1.1.1"],"nics":[{"nic_tag":"admin","ips":["dhcp"]}]}' | vmadm create
zlogin uuidFromAboveCommand
Analysis
In systemd v253 and earlier, systemd's file-locking code would try to obtain an Open File Description (OFD) lock via
fcntl(…F_OFD_SETLKW…)
, and when that failed it would fall back toflock(…F_SETLKW…)
. However, systemd v254 dropped the fallback, so it now requires support for OFD locks.SmartOS LX does not support OFD locks, so
systemd-sysusers
v254 fails lock/etc/passwd
, which in turn causes Debianapt upgrade
to fail.Proposed change
Update SmartOS LX's
fcntl
wrapper to use SmartOS's native support for OFD locks.I have locally built SmartOS with this change, and confirmed that this change enables systemd v254+'s
systemd-sysusers
to run successfully, and thus enablesapt upgrade
to complete.Before:
After: